template-rollup-typescript
template-rollup-typescript copied to clipboard
Replace rollup-plugin-uglify with rollup-plugin-terser for es6 compatibility
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({