-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
68 lines (65 loc) · 1.78 KB
/
webpack.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
64
65
66
67
68
/**
* Created by FengZQ on 2016/6/12.
* webpack config file
*/
"use strict";
var webpack = require('webpack');
module.exports = {
//提取公共lib
plugins: [
new webpack.optimize.CommonsChunkPlugin('common.js'),
//new webpack.optimize.UglifyJsPlugin({
// compress:{
// drop_console:true,
// warnings:false
// }
//}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
React: 'react',
ReactDOM: 'react-dom'
})
],
//页面入口
entry: {
index: './src/js/index.jsx',
demo2: './src/js/demo2.jsx',
demo3: './src/js/demo3.jsx',
demo4: './src/js/demo4.jsx',
demo5: './src/js/demo5.jsx',
demo6: './src/js/demo6.jsx',
demo7: './src/js/demo7.jsx',
demo8: './src/js/demo8.jsx',
demo9: './src/js/demo9.jsx',
demo10: './src/js/demo10.jsx',
demo11: './src/js/demo11.jsx',
demo12: './src/js/demo12.jsx',
demo13: './src/js/demo13.jsx',
demo14: './src/js/demo14.jsx'
},
//输出配置
output: {
path: './build/js',
filename: '[name].bundle.js'
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.(jpg|png)$/, loader: 'url?limit=8192' }
]
},
resolve: {
alias: {
jquery: './jquery-1.11.3.min'
}
}
};