template-rollup-typescript icon indicating copy to clipboard operation
template-rollup-typescript copied to clipboard

Replace rollup-plugin-uglify with rollup-plugin-terser for es6 compatibility

Open dave-stevens-net opened this issue 5 years ago • 0 comments

rollup-plugin-uglify no longer supports es6 and should be replaced by rollup-plugin-terser.

When I ran my first prod build I received the following error using rollup-plugin-uglify:

[!] (plugin uglify) Error: Unexpected token: name «YourFirstClassReference», expected: punc «;»

To fix this on your project do the following:

npm i rollup-plugin-terser --save-dev
npm un rollup-plugin-uglify

Then replace the following 2 lines in your rollup.config.dist.js file.

-import { uglify } from 'rollup-plugin-uglify';
+import { terser } from 'rollup-plugin-terser';
-        uglify({
+        terser({

dave-stevens-net avatar Apr 04 '20 13:04 dave-stevens-net