-
Notifications
You must be signed in to change notification settings - Fork 12k
Add option to output styles inline #11395
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
Comments
Useful for critical/“above-the-fold” CSS. Maybe it’s also possible to process the contents of a |
What is the status with this ticket?
Or
And it will add the styles in the index.html inline in the head with |
I would also suggest adding
With above settings, Angular CLI should inline the contents of |
Hi, is there any hope of this ever becoming a feature? I would add that inlining the main bundle would also be a great feature. Thanks again |
Hi, We did an RFC for this see: #18730. In the prerelease version of Angular CLI v11 inlining of fonts is already available, other parts of the RFC are scheduled to be available in 11.1. |
Yeah I actually heard @mgechev mention it on the latest Angular podcast - I'm so happy - this is YUUGE guys! |
…optimizations This is another feature that we mentioned in the Eliminate Render Blocking Requests RFC (#18730) Inlining of critical CSS is turned off by default. To opt-in this feature set `inlineCritical` to `true`. Example: ```json "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": { "styles": { "minify": true, "inlineCritical": true, } }, ``` To learn more about critical CSS see; https://web.dev/defer-non-critical-css https://web.dev/extract-critical-css/ In a future version of the Angular CLI `inlineCritical` will be enabled by default. Closes: #17966 Closes: #11395 Closes: #19445
Amazing work @alan-agius4 @clydin 👍 |
I'm gonna pour myself a gin/tonic and celebrate this. Thank you @alan-agius4 ! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Area
Desired functionality
It would be cool if there was a build-option that would take the processed/minified css and put it inline in a <style>-element in index.html instead of as a seperate file.
Useful when it doesn't change so often, and the styles are limited.
Rob asked me to make a Feature-request... https://twitter.com/robwormald/status/1012084975766626304
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: