-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
37 lines (36 loc) · 1.09 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
37 lines (36 loc) · 1.09 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
var webpack=require('webpack');
module.exports = {
entry: __dirname+'/src/index.js',
output: {
path:__dirname+'/dist',//打开后webpack-dev-server处理后入口HTML找不到bundle文件
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react' ,'stage-0']
}
},
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{
test: /\.(png|jpg|jpeg|gif)$/,
loader: 'url-loader?limit=50000&name=imgs/[name].[ext]',
}
]
},
devServer:{
historyApiFallback: true,
// inline: true,//注意:不写hot: true,否则浏览器无法自动更新;也不要写colors:true,progress:true等,webpack2.x已不支持这些
},
plugins:[
// new webpack.HotModuleReplacementPlugin()
// new htmlWebpackPlugin({
// template: './index.html',
// })
]
}