-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot.js
40 lines (38 loc) · 1.04 KB
/
boot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const DEV = (process.env.NODE_ENV !== 'production')
// require('source-map-support').install()
require('app-module-path/cwd')
require('babel-polyfill')
require('babel-register')({
"presets": ["node6"],
"plugins": [
"transform-es2015-modules-commonjs",
["system-import-transformer", {
"modules": "commonjs"
}]
// "babel-plugin-webpack-loaders"
]
})
require('images-require-hook')([
'jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'
].map(ext => `.${ext}`), '')
require('css-modules-require-hook')({
devMode: DEV,
rootDir: process.cwd(),
generateScopedName: '[local]', //DEV ? '[local]' : '[hash:base64:5]',
extensions: ['.scss'],
preprocessCss(data, filename) {
const {renderSync} = require('node-sass')
const includePaths = []
const {css} = renderSync({data, includePaths})
return css
}
})
if (DEV) require('dotenv').config({
path: '.env'
})
Object.assign(global, {
DEV,
__DEV__: DEV,
BROWSER: false,
Promise: require('bluebird')
})