-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (44 loc) · 1.18 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
var path = require('path');
var webpack = require('webpack');
var AssetsPlugin = require('assets-webpack-plugin');
var reload = require('./development/reload');
module.exports = {
devtool: 'cheap-eval-module-source-map',
entry: {
app: [].concat(
process.env.NODE_ENV === 'development' ? [
'webpack-hot-middleware/client',
] : [],
path.join(__dirname, 'application/index')
),
},
output: {
path: path.join(__dirname, 'build/release/dist'),
filename: '[name].[hash].js',
publicPath: process.env.NODE_ENV === 'production' ? 'dist/' : '/dist/',
},
module: {
loaders: [
{ test: /\.jsx?$/, include: path.join(__dirname, 'application'), loader: 'babel' },
],
},
plugins: [].concat(
process.env.NODE_ENV === 'development' ? [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
] : [],
[
new webpack.DefinePlugin({
process: {
env: {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'production'),
},
},
}),
new AssetsPlugin({
path: path.join(__dirname, 'build'),
processOutput: reload,
}),
]
),
};