-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
44 lines (42 loc) · 1.03 KB
/
webpack.dev.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
/**
* Created by shenlu on 17/2/27.
*/
const webpack = require('webpack');
module.exports = {
context: __dirname + "/src",
entry: {
main: "./index.js",
vendor: [
'react',
'react-dom',
'react-redux',
'redux',
'redux-saga'
]
},
output: {
path: __dirname + "/public",//打包后的文件存放的地方
filename: "bundle.js"//打包后输出文件的文件名
},
module: {
loaders: [
{test: /\.(js|jsx)$/,exclude: /node_modules/,loader: "babel"},
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),//打包第三方库
//打包生成css
//new ExtractTextPlugin("[name].css"),
//去除没有用的css
//new HtmlWebpackUncssPlugin(),
],
devServer: {
contentBase: './src',
hot: true,
inline: true,
secure: false,
historyApiFallback: true,
proxy: {
}
}
}