-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathwebpack.config.js
More file actions
43 lines (42 loc) · 883 Bytes
/
webpack.config.js
File metadata and controls
43 lines (42 loc) · 883 Bytes
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
module.exports = {
entry: './src/entries/index.js', //入口文件
output: {
path:"./dist",
filename: 'bundle.js' //出口
},
//devtool: 'source-map', //直接生成srouce-map 已在script里面配置
/*devServer: {
port: 8088,
inline: true
},*/
//devServer:{
// proxy:{
// '/api/**': {
// target: 'http://127.0.0.1:3000',
// pathRewrite: {'^/api' : ''},
// secure: false
// }
// }
//},
module: {
loaders: [{
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.js[x]?$/,//, /\.js$/
loader: 'react-hot!babel',
exclude: /node_modules/ //排除那些目录
},
{
test: /\.json$/,
loader: "json"
},
{
test: /\.less$/,
loader: "style!css!less"
}]
},
resolve: {
"extensions": ['', '.js', '.css', '.json', '.jsx','less'] //可以省略后缀名
}
};