-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.dev.js
38 lines (37 loc) · 1.18 KB
/
webpack.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
let webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
let path = require('path');
module.exports = merge.smart(common, {
entry: {
'app': [
'webpack-dev-server/client?http://localhost:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'bootstrap-loader', // Loads Twitter Bootstrap
'./index.jsx',
], // Appʼs entry point
'visor': path.join(__dirname, '/_visor/containers/VisorApp.jsx'),
},
output: {
path: path.join(__dirname, '/dist'),
publicPath: '/', // This is used to generate URLs to e.g. images
filename: '[name]-bundle.js',
},
devtool: 'cheap-module-eval-source-map',
watch: true,
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
debug: true,
}),
],
devServer: {
contentBase: path.join(__dirname, '/dist'),
hot: true,
inline: true,
port: 8080,
headers: {
'Access-Control-Allow-Origin': '*',
},
},
});