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

Add support for terser-webpack-plugin (webpack@4.26.0+) #426

Closed
pleunv opened this issue Nov 21, 2018 · 4 comments · Fixed by #436
Closed

Add support for terser-webpack-plugin (webpack@4.26.0+) #426

pleunv opened this issue Nov 21, 2018 · 4 comments · Fixed by #436

Comments

@pleunv
Copy link

pleunv commented Nov 21, 2018

Webpack 4.26.0 switched from using uglifyjs-webpack-plugin to terser-webpack-plugin. Since OfflinePlugin seems to partly piggyback off webpack's minifier but also contains uglifyjs-specific code this is now throwing up the following error:

OfflinePlugin: uglifyjs-webpack-plugin is required to preform a minification

Messed around a little bit myself but adding terser support while maintaining uglifyjs support for < webpack@4.26.0 involves a bit more than updating the import, unfortunately.

Those running into this issue can meanwhile explicitly add uglifyjs-webpack-plugin to the dev dependencies until this is resolved.

@pleunv pleunv changed the title Add support for terser-webpack-plugin Add support for terser-webpack-plugin (webpack@4.26.0+) Nov 21, 2018
@GGAlanSmithee
Copy link
Collaborator

@pleunv thanks for the report 👍

@Bobgy
Copy link
Contributor

Bobgy commented Jan 29, 2019

I tried to patch offline-plugin in my forked branch about this issue. What I did was simply passing uglifyOptions as terserOptions and that fixed the issue for me because terser seems to only have new options over uglifyjs.

I will try to clean up the implementation and submit a PR.

@Bobgy
Copy link
Contributor

Bobgy commented Feb 1, 2019

@GGAlanSmithee I've submitted the PR. Any chance you can merge it?
It's passing CI, so I need someone for code review.

@GGAlanSmithee
Copy link
Collaborator

@Bobgy I've left a few comments, and I think we can merge this. However, only @NekR can actually deploy this to npm, so he will have the last word.

GGAlanSmithee pushed a commit that referenced this issue Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants