-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (61 loc) · 1.64 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
58
59
60
61
const webpack = require('webpack');
module.exports = {
entry: [
'webpack-hot-middleware/client',
'./src/client/index.jsx'
],
output: {
path: '/dist',
filename: 'app.bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devtool: 'source-map',
module: {
preLoaders: [
{
test: /\.jsx$/,
exclude: /node_modules|test/,
loader: 'eslint-loader'
}
],
loaders: [
{
test: /\.jsx$/,
exclude: /node_modules/,
loaders: ['react-hot-loader/webpack', 'babel']
},
{
test: /\.less$/,
exclude: /node_modules/,
loaders: ['style', 'css', 'postcss-loader', 'less']
},
{
test: /\.css$/,
loader: 'style!css?modules'
},
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file'
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff2?$|\.ttf$|\.wav$|\.mp3$|\.eot$|\.json$/,
loader: "file"
}
]
},
eslint: {
configFile: './.eslintrc.json'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.OldWatchingPlugin(),
new webpack.DefinePlugin({
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
IS_PRODUCTION: process.env.NODE_ENV === 'prod',
IS_DEVELOPMENT: process.env.NODE_ENV === 'dev'
})
]
};