Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');

// const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');

// Webpack uses `publicPath` to determine where the app is being served from.
Expand Down Expand Up @@ -98,7 +99,7 @@ module.exports = {
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
devtool: shouldUseSourceMap ? 'source-map' : false,
// devtool: shouldUseSourceMap ? 'source-map' : false,
// In production, we only want to load the app code.
entry: [paths.appLibIndexJs], // CRL: update entry
output: {
Expand All @@ -116,7 +117,19 @@ module.exports = {
optimization: {
minimizer: [
new TerserPlugin({
minify: (file, sourceMap) => {
const uglifyJsOptions = {};

if (sourceMap) {
uglifyJsOptions.sourceMap = {
content: sourceMap
};
}

return require('uglify-js').minify(file, uglifyJsOptions);
},
terserOptions: {
warnings: false,
parse: {
// we want terser to parse ecma 8 code. However, we don't want it
// to apply any minfication steps that turns valid ecma 5 code
Expand Down Expand Up @@ -155,7 +168,7 @@ module.exports = {
parallel: true,
// Enable file caching
cache: true,
sourceMap: shouldUseSourceMap
sourceMap: false
}),
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
Expand Down
Loading