Closed jswiderski closed 3 months ago
When building with --mode production you get UglifyJs Unexpected token: keyword (const) because Uglify doesn't support ES6 modules. We had this issue in CKEditor 5 thus we have switched our builds to Terser.
--mode production
UglifyJs Unexpected token: keyword (const)
We should probably do the same for collaboration samples. For example, below lines: https://github.com/ckeditor/ckeditor5-collaboration-samples/blob/master/track-changes-for-angular/vendor/ckeditor5/webpack.config.js#L33-L46 https://github.com/ckeditor/ckeditor5-collaboration-samples/blob/master/track-changes-for-angular/vendor/ckeditor5/package.json#L39
should be replaced with:
webpack.config.js
const TerserPlugin = require( 'terser-webpack-plugin' ); ... optimization: { minimizer: [ new TerserPlugin( { sourceMap: true, terserOptions: { output: { // Preserve CKEditor 5 license comments. comments: /^!/ } }, extractComments: false } ) ] },
package.json
"terser-webpack-plugin": "^2.2.1",
Link to Uglify - https://github.com/mishoo/UglifyJS/issues/3156#issuecomment-421509930. It seems no longer maintained.
Since we migrated to new installation methods, and away from webpack, this is no longer relevant.
When building with
--mode production
you getUglifyJs Unexpected token: keyword (const)
because Uglify doesn't support ES6 modules. We had this issue in CKEditor 5 thus we have switched our builds to Terser.We should probably do the same for collaboration samples. For example, below lines:
https://github.com/ckeditor/ckeditor5-collaboration-samples/blob/master/track-changes-for-angular/vendor/ckeditor5/webpack.config.js#L33-L46
https://github.com/ckeditor/ckeditor5-collaboration-samples/blob/master/track-changes-for-angular/vendor/ckeditor5/package.json#L39
should be replaced with:
webpack.config.js
package.json
Link to Uglify - https://github.com/mishoo/UglifyJS/issues/3156#issuecomment-421509930. It seems no longer maintained.