-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (35 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
var webpack = require('webpack');
var path = require('path');
var publicPath = 'http://localhost:3000/';
var hotMiddlewareScript = 'webpack-hot-middleware/client?reload=true';
var devConfig = {
entry: {
page1: ['./client/page1', hotMiddlewareScript],
page2: ['./client/page2', hotMiddlewareScript]
},
output: {
filename: './[name]/bundle.js',
path: path.resolve(__dirname, './public'),
publicPath: publicPath
},
devtool: 'eval-source-map',
module: {
rules: [{
test: /\.(png|jpg)$/,
use: 'url-loader?limit=8192&context=client&name=[path][name].[ext]'
}, {
test: /\.scss$/,
use: [
'style-loader',
'css-loader?sourceMap',
'resolve-url-loader',
'sass-loader?sourceMap'
]
}]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
]
};
module.exports = devConfig;