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

JS copied with copyFiles still minified #1212

Open
mattsbennett opened this issue Jun 13, 2023 · 1 comment
Open

JS copied with copyFiles still minified #1212

mattsbennett opened this issue Jun 13, 2023 · 1 comment

Comments

@mattsbennett
Copy link

mattsbennett commented Jun 13, 2023

Recently we discovered (due to a related bug) we were re-minifying pre-minified JS libraries we were copying into place & content-hash-naming with copyFiles. This was unexpected due to the following copyFiles documentation:

webpack-encore/index.js

Lines 569 to 571 in c673202

* Notes:
* * No transformation is applied to the copied files (for instance
* copying a CSS file won't minify it)

It probably shouldn't have been unexpected, given the copied files were JS and the terser plugin just processes everything in the build target by default, but these details are also somewhat "below the surface" when using an implementation like encore.

Perhaps some documentation could be added here for this use-case, highlighting that any pre-minified JS processed this way (e.g. third-party libraries) must also be explicitly excluded from repeat-minification with configureTerserPlugin?

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

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

2 participants