Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Uglify with Terser #22

Closed
jswiderski opened this issue Jun 25, 2020 · 1 comment
Closed

Replace Uglify with Terser #22

jswiderski opened this issue Jun 25, 2020 · 1 comment

Comments

@jswiderski
Copy link

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

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 - mishoo/UglifyJS#3156 (comment). It seems no longer maintained.

@ma2ciek ma2ciek self-assigned this Sep 2, 2020
@f1ames
Copy link
Contributor

f1ames commented Aug 7, 2024

Since we migrated to new installation methods, and away from webpack, this is no longer relevant.

@f1ames f1ames closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants