-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.client.js
65 lines (59 loc) · 1.49 KB
/
webpack.config.client.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
58
59
60
61
62
63
64
65
const path = require('path');
const webpack = require('webpack');
const nib = require('nib');
const jeet = require('jeet');
const rupture = require('rupture');
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-hot-middleware/client?http://0.0.0.0:3000/',
'webpack/hot/only-dev-server',
'./client/index.js',
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/dist/'
},
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.jsx?$/,
use: [
'babel-loader',
],
exclude: /node_modules/,
},
{
test: /\.styl$/,
use: [
'style-loader',
'css-loader',
{
loader: 'stylus-loader'
},
],
}
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.LoaderOptionsPlugin({
options: {
stylus: {
use: [nib(), jeet(), rupture()]
},
context: '/'
}
}),
],
devServer: {
host: 'localhost',
port: 3000,
historyApiFallback: true,
hot: true,
},
};