2017-05-17 07:09:47 +00:00
|
|
|
/* eslint-disable */
|
2019-07-10 04:17:25 +00:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
|
|
const ManifestPlugin = require('webpack-manifest-plugin');
|
2016-02-27 21:53:11 +00:00
|
|
|
|
2018-01-04 05:35:13 +00:00
|
|
|
commonWebpackConfig = require('./webpack.config');
|
2016-02-27 21:53:11 +00:00
|
|
|
|
|
|
|
productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
|
|
|
cache: true,
|
2017-07-11 05:54:26 +00:00
|
|
|
devtool: 'source-map',
|
2017-10-26 05:49:04 +00:00
|
|
|
entry: ['babel-polyfill', 'babel-regenerator-runtime', './app/index'],
|
2016-02-27 21:53:11 +00:00
|
|
|
output: {
|
2018-01-04 05:38:02 +00:00
|
|
|
path: path.join(__dirname, 'dist'),
|
2016-05-24 03:35:19 +00:00
|
|
|
filename: 'bundle.[hash].js',
|
|
|
|
publicPath: '/static/',
|
2016-02-27 21:53:11 +00:00
|
|
|
},
|
2018-01-04 01:35:51 +00:00
|
|
|
stats: "normal"
|
2016-02-27 21:53:11 +00:00
|
|
|
});
|
2018-01-22 06:24:10 +00:00
|
|
|
productionWebpackConfig.plugins = [
|
|
|
|
...productionWebpackConfig.plugins,
|
|
|
|
new ManifestPlugin(),
|
2017-05-17 07:09:47 +00:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'server/static/index.html',
|
2018-01-22 06:24:10 +00:00
|
|
|
}),
|
2018-05-12 21:42:10 +00:00
|
|
|
new UglifyJsPlugin({
|
2018-01-04 00:58:34 +00:00
|
|
|
sourceMap: true,
|
2018-05-12 21:42:10 +00:00
|
|
|
uglifyOptions: {
|
2018-12-05 06:36:13 +00:00
|
|
|
compress: true,
|
|
|
|
keep_fnames: true
|
2018-05-12 21:42:10 +00:00
|
|
|
}
|
2018-01-22 06:24:10 +00:00
|
|
|
}),
|
2017-07-11 03:10:54 +00:00
|
|
|
new webpack.DefinePlugin({
|
2018-11-18 03:09:48 +00:00
|
|
|
'process.env.URL': JSON.stringify(process.env.URL),
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
|
|
'process.env.GOOGLE_ANALYTICS_ID': JSON.stringify(process.env.GOOGLE_ANALYTICS_ID),
|
2018-11-18 07:30:05 +00:00
|
|
|
'process.env.SUBDOMAINS_ENABLED': JSON.stringify(process.env.SUBDOMAINS_ENABLED === 'true'),
|
2019-04-18 02:11:23 +00:00
|
|
|
'process.env.WEBSOCKETS_ENABLED': JSON.stringify(process.env.WEBSOCKETS_ENABLED === 'true'),
|
2018-01-22 06:24:10 +00:00
|
|
|
}),
|
|
|
|
];
|
2016-02-27 21:53:11 +00:00
|
|
|
|
|
|
|
module.exports = productionWebpackConfig;
|