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

Fix script for extracting CSS URLs from webpack.js + unpacking *.css files #6

Open
0xdevalias opened this issue Feb 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@0xdevalias
Copy link
Owner

In the past there was only a single *.css URL extracted from webpack.js from the miniCssF field, so it was unpacked as miniCssF.css (as the *.css files hashes change every time they are re-built, and they don't seem to have a static chunk part to their filename when downloaded)

More recently, there have been new *.css files specific to certain chunks (sometimes shared among multiple chunks), and so the scripts for extracting this are broken and produce an entry like this:

https://cdn.oaistatic.com/_next/undefined

We also need to think about how best to name the files. I think main.css would probably work for the 'main' chunk (previously what we called miniCssF). For the *.css related to the other chunks, if they only applied to a single chunk I would probably have named them based on that chunk, but sometimes they are used in multiple chunks. If doing it manually we could probably figure out what they are used for and name them based on that, but not sure the best way to do this automatically. We can't use the hash of the *.css file, as that changes every time the file changes.

@0xdevalias 0xdevalias added the bug Something isn't working label Feb 24, 2024
@0xdevalias 0xdevalias reopened this Feb 25, 2024
@0xdevalias
Copy link
Owner Author

Fixed extract-webpack-urls.js to handle both single and multiple CSS chunk urls in 1c12729

Still need to figure out the best way to rename the css chunks + update unpack-files-from-orig.js accordingly.

@0xdevalias 0xdevalias self-assigned this Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant