-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack-base.config.js
63 lines (61 loc) · 1.43 KB
/
webpack-base.config.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var path = require('path');
var webpack = require('webpack');
var ServiceWorkerWebpackPlugin = require( 'serviceworker-webpack-plugin');
module.exports = {
entry: [
//'webpack/hot/dev-server' ,
'./src/index.js'
],
output: {
publicPath: '',
path: path.join(__dirname, ''),
filename: 'bundle.js'
},
devtool: 'eval',
module: {
preLoaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'source-map-loader'
}
],
noParse: /node_modules\/localforage\/dist\/localforage.js/,
loaders: [{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel',
query: {
cacheDirectory: '/tmp',
"presets": [
"es2015",
"react",
"stage-0",
// "escompress"
],
"plugins": [
// "transform-es2015-destructuring",
// // "transform-es2015-spread",
// "transform-dead-code-elimination",
// "transform-object-rest-spread",
"transform-class-properties",
]
}
}]
},
resolve: {
modulesDirectories: [path.join(__dirname, 'src'), 'node_modules']
},
plugins: [
new ServiceWorkerWebpackPlugin({
entry: path.join(__dirname, 'src/sw.js'),
publicPath: '',
assets: [
]
}),
new webpack.DefinePlugin({
EDITION: JSON.stringify("Blue"),
VERSION: JSON.stringify("0.4.1"),
})
]
};