-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (54 loc) · 1.44 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const webpack = require('webpack');
const path = require('path');
const sourceDir = 'source';
const options = {
entry: [
'webpack-dev-server/client?http://localhost:127.0.0.1:8080',
'webpack/hot/only-dev-server',
'./source/web/main.js',
],
output: {
filename: 'bundle.js'
},
stats: {
colors: true,
reasons: true,
},
module: {
loaders: [{
test: /\.(js|jsx)$/,
loaders: ['eslint-loader'],
include: path.join(__dirname, sourceDir),
enforce: 'pre',
}, {
test: /\.(js|jsx)$/,
loaders: ['react-hot-loader', 'babel-loader'],
include: [
path.join(__dirname, sourceDir),
],
}, {
test: /\.json$/,
loaders: 'json-loader',
include: path.join(__dirname, sourceDir)
}, {
test: /\.scss$/,
loaders: ['css', 'scss'],
include: path.join(__dirname, sourceDir)
}],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
devServer: {
proxy: { // proxy URLs to backend development server
'/api': 'http://localhost:3000'
},
contentBase: path.join(__dirname, sourceDir),
compress: true,
historyApiFallback: true,
hot: true,
https: false,
noInfo: true,
},
};
module.exports = options;