forked from firekylin/firekylin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
55 lines (54 loc) · 1.22 KB
/
webpack.config.babel.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
import path from 'path';
import webpack from 'webpack';
var base = path.join(__dirname, 'www/static');
export default {
devtool: 'source-map',
entry: {
admin: `${base}/src/admin/app.jsx`,
vendor: [
'md5',
'react',
'moment',
'react-dom',
'classnames',
'react-router',
'qrcode-react',
'react-bootstrap',
'react-bootstrap-validation'
]
},
output: {
path: `${base}/js`,
filename: '[name].bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
admin: `${base}/src/admin`,
common: `${base}/src/common`,
base: `${base}/src/common/component/base`
}
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
cacheDirectory: true,
query: {
presets: ['react', 'es2015-loose', 'stage-0'],
plugins: ['transform-runtime', 'transform-decorators-legacy']
},
exclude: /node_modules/
},
{
test: /\.css?$/,
loader: 'style!css'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'common.js'}),
//new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
]
};