This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/webpack.config.prod.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-05-17 07:09:47 +00:00
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const TerserPlugin = require('terser-webpack-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, {
output: {
path: path.join(__dirname, 'build/app'),
filename: '[name].[contenthash].js',
publicPath: `${process.env.CDN_URL || ""}/static/`,
2016-02-27 21:53:11 +00:00
},
cache: true,
mode: "production",
devtool: 'source-map',
entry: ['./app/index'],
stats: "normal",
optimization: {
...commonWebpackConfig.optimization,
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: undefined,
parse: {},
compress: {},
mangle: true, // Note `mangle.properties` is `false` by default.
module: false,
output: null,
toplevel: false,
nameCache: null,
ie8: false,
keep_classnames: undefined,
keep_fnames: true,
safari10: false,
},
}),
],
},
2016-02-27 21:53:11 +00:00
});
2018-01-22 06:24:10 +00:00
productionWebpackConfig.plugins = [
...productionWebpackConfig.plugins,
new WebpackManifestPlugin()
2018-01-22 06:24:10 +00:00
];
2016-02-27 21:53:11 +00:00
module.exports = productionWebpackConfig;