Skip to content

Commit 05ae605

Browse files
committed
Stop mangling component names in next demo.
1 parent 9583c25 commit 05ae605

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/react-renderer-demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"cross-env": "^5.2.0",
5656
"firebase-functions-test": "^0.1.6",
5757
"firebase-tools": "^6.1.0",
58-
"rimraf": "^2.6.0"
58+
"rimraf": "^2.6.0",
59+
"terser-webpack-plugin": "^2.2.1"
5960
}
6061
}

packages/react-renderer-demo/src/app/next.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const TerserPlugin = require('terser-webpack-plugin');
12
const withCSS = require('@zeit/next-css');
23
const resolve = require('resolve');
34
const withMDX = require('@next/mdx')({
@@ -70,6 +71,17 @@ module.exports = withBundleAnalyzer(withMDX(withCSS({
7071
fs: 'empty',
7172
};
7273

74+
config.optimization.minimizer = [
75+
...config.optimization.minimizer,
76+
new TerserPlugin({
77+
cache: true,
78+
parallel: true,
79+
terserOptions: {
80+
keep_classnames: true, // eslint-disable-line
81+
keep_fnames: true, // eslint-disable-line
82+
},
83+
}),
84+
];
7385
return config;
7486
},
7587
})));

0 commit comments

Comments
 (0)