-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (42 loc) · 1.15 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
var webpack = require('webpack');
var path = require('path');
module.exports = {
// 配置服务器
devServer: {
historyApiFallback: true,
hot: true,
inline: true,
progress: true,
contentBase: '.', //最好写上,否则报错,难道这里是一个坑?
port: 8080,
proxy: {
'/api/*': {
target: 'http://127.0.0.1:8000',
secure: false
}
}
},
entry: [
"webpack-dev-server/client?http://0.0.0.0:8080",
"webpack/hot/only-dev-server",
"./js/entry.js"
],
output: {
publicPath: 'build',
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.js?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ },
// { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{ test: /\.css$/, loader: "style!css" },
{test: /\.less/,loader: 'style-loader!css-loader!less-loader'}
]
},
resolve:{
extensions:['','.js','.json']
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};