-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.dev.js
54 lines (48 loc) · 1.15 KB
/
webpack.config.dev.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
47
48
49
50
51
52
53
54
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:3030',
'webpack/hot/dev-server',
path.join(__dirname, 'app')
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader" },
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react-hmre']
}
},
{
test: /^((?!\.local).)*\.css$/,
loaders: ['style', 'css', 'cssnext']
},
{
test: /\.local.css$/,
loaders: ['style', 'css?modules&localIdentName=[local]---[hash:base64:5]', 'cssnext']
},
{ test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, loader: 'url-loader?limit=100000' }
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.webpack.js', '.web.js']
},
devServer: {
inline: true,
hot: true,
port: 3030,
contentBase: path.join(__dirname, 'public')
}
};