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
Tom Moor 3bace8c9e4
fix: Restore DNS prefetching for static resources (#1820)
* fix: Restore DNS prefetching for static resources

* fix: CDN paths
feat: preload instead of prefetch for key bundles

* csp

* fix: Turns out prefetch-src is still behind a flag in Chrome, not publicly available yet
2021-01-18 15:48:46 -08:00

49 lines
1.2 KiB
JavaScript

/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const TerserPlugin = require('terser-webpack-plugin');
commonWebpackConfig = require('./webpack.config');
productionWebpackConfig = Object.assign(commonWebpackConfig, {
output: {
path: path.join(__dirname, 'build/app'),
filename: '[name].[contenthash].js',
publicPath: `${process.env.CDN_URL || ""}/static/`,
},
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,
},
}),
],
},
});
productionWebpackConfig.plugins = [
...productionWebpackConfig.plugins,
new WebpackManifestPlugin()
];
module.exports = productionWebpackConfig;