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

Losing data when deleteOriginalAssets is used in compression plugin #109

Open
amw opened this issue Dec 31, 2021 · 2 comments
Open

Losing data when deleteOriginalAssets is used in compression plugin #109

amw opened this issue Dec 31, 2021 · 2 comments

Comments

@amw
Copy link
Contributor

amw commented Dec 31, 2021

When the compression plugin is told to remove original asset (for example for use with nginx gzip_static + gunzip options) the bundle tracker only saves the .gz version keys in assets dictionary and the chunk assets list is empty ("mychunk": []).

Expected behavior would be that assets continues listing the deleted uncompressed files and that chunks reference the assets without .gz suffix.

@fjsj
Copy link
Member

fjsj commented Dec 31, 2021

Hi @amw could you please share your config? webpack-bundle-tracker should not conflict with the compression plugin you're referring to.

@amw
Copy link
Contributor Author

amw commented Apr 3, 2022

Sorry that it took a while, but I've created a complete repro Gist. Please note how my main entry inside chunks is empty here:
https://gist.github.com/amw/bfcb52b2e05412e6775af53f9531f9d9#file-webpack-stats-json-L11
And assets only lists the .gz version of the file:
https://gist.github.com/amw/bfcb52b2e05412e6775af53f9531f9d9#file-webpack-stats-json-L4

In this situation there is no way to map from main chunk to main-ac5703ff529608b52267.js filename to allow nginx to serve this file with gzip_static + gunzip options.

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