-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.config.js
More file actions
58 lines (58 loc) · 1.51 KB
/
webpack.prod.config.js
File metadata and controls
58 lines (58 loc) · 1.51 KB
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
const webpack = require('webpack');
module.exports = {
entry: [
'./src/client/index.jsx'
],
output: {
path: './dist',
filename: 'app.bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
preLoaders: [
{
test: /\.jsx$/,
exclude: /node_modules|test/,
loader: 'eslint-loader'
}
],
loaders: [
{
test: /\.jsx$/,
exclude: /node_modules/,
loaders: ['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.optimize.UglifyJsPlugin(),
new webpack.DefinePlugin({
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
IS_PRODUCTION: process.env.NODE_ENV === 'production',
IS_DEVELOPMENT: process.env.NODE_ENV === 'dev'
})
]
};