forked from caiyuying0429/PSMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (53 loc) · 1.44 KB
/
Copy pathwebpack.config.js
File metadata and controls
54 lines (53 loc) · 1.44 KB
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
9/**
* Created by sa on 16-12-15.
*/
var webpack = require("webpack");
var path = require("path");
module.exports = {
entry:{
main:path.resolve(__dirname,"main.js"),
//vendors: []
},
output:{
path:"build",
filename:"[name].js",
publicPath:"build/"
},
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
stats: { colors: true },
proxy: {
'/api/*': {
target:'http://35.161.236.80:5556',//'http://35.161.236.80:5555',//,//'http://192.168.0.3:5555',//0.39
changeOrigin: true
}
}
},
module:{
loaders:[
{test:/\.css/,loader:'style!css'},
{test:/\.(png|jpg)$/,loader:'url-loader?limit=8192&name=img/[hash:8].[name].[ext]'},
{test:/\.js[x]?$/,loader:'babel-loader',exclude:'/node_modules/'}
]
},
resolve:{
extensions:['','.js','.jsx',".css"],
alias:{
"jquery":"./node_modules/jquery/dist/jquery",
"bootstrapJs":"./node_modules/bootstrap/dist/js/bootstrap",
}
},
externals:{
'jquery':'window.jQuery'
},
plugin:[
new webpack.HotModuleReplacementPlugin(),
new webpack.ProvidePlugin({
$: 'jquery', //加载$全局
jQuery: 'jquery' //加载$全局
}),
//new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
]
}