-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
40 lines (39 loc) · 977 Bytes
/
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
40
const webpack = require('webpack');
module.exports = {
// devtool: 'cheap-module-eval-source-map',
devtool: 'source-map',
entry: {
app: ['webpack/hot/dev-server', './src/js/main.js'],
},
target: 'node',
output: {
path: './dist',
filename: 'bundle.js',
publicPath: 'http://localhost:8080/dist/'
},
devServer: {
contentBase: './src',
publicPath: 'http://localhost:8080/dist/'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['transform-decorators-legacy'],
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
{ test: /\.json$/,
loader: 'json-loader'
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};