-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathwebpack.config.js
39 lines (36 loc) · 1.01 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
var path = require('path');
var webpack = require('webpack');
var port = 3078;
// webpack.config.js
module.exports = {
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /(bower_components|node_modules)/,
loaders: ['react-hot', 'babel']
}]
},
resolve: {
extensions: ['', '.js', '.json', '.jsx']
},
entry: {
demo: [
'webpack-dev-server/client?http://0.0.0.0:' + port, // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./demo' // Your appʼs entry point
]
},
output: {
// Make sure to use [name] or [id] in output.filename
// when using multiple entry points
filename: "[name].bundle.js",
chunkFilename: "[id].bundle.js"
},
devServer: {
contentBase: path.resolve(__dirname, "demo/assets"),
port: port
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};