Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Minify and hash inject_styles.js #1524

Merged
merged 1 commit into from Sep 18, 2020

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Sep 17, 2020

inject_styles can be emitted as a chunk instead of an asset since it's a .js file. This allows it to be minified, which makes a better use of bandwidth. It also makes it have a hash in it's name, which is important for avoiding caching bugs. URLs under the /client path are cached. I potentially wanted to change the contents of inject_styles while coming up with a fix for #1505 (e.g. as in #1525), but that wouldn't work if the file is cached because users would get the old version of the file

Also, I think it would be nice to have inject_styles be processed by Babel. This seems like it would be necessary for that to happen. However, from my testing, it does not appear sufficient

@ArekBartnik
Copy link
Contributor

@benmccann page speed also points that inject_styles.js should be preloaded.

@benmccann
Copy link
Member Author

Ah, good call out. The work on this is never done :-p

I'm going to go head and merge this one to unblock #1525

@benmccann benmccann merged commit b162c63 into sveltejs:master Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants