You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Reacted by Cory Rylan , Sumanth Chinthagunta, Christian Liebel, Ovidijus Stukas, Dennis Zoma, Bart Meinders, Hugh Anderson, Jeroen van Beek, René Panzar, João Pescada and 10 more
With above settings, Angular CLI should inline the contents of critical-path-styles.scss in head tag, and it should generate <link href="/lazy-styles.96106fab.css" rel="preload" as="style" onload="this.rel='stylesheet'"> for lazy-styles.scss.
Hi, is there any hope of this ever becoming a feature?
Running lighthouse tests just gives red lights all over because of this. It's a pretty common thing to inline resources and it would be a great cli feature.
I would add that inlining the main bundle would also be a great feature.
Activity
christianliebel commentedon Sep 21, 2018
Useful for critical/“above-the-fold” CSS. Maybe it’s also possible to process the contents of a
styletag insrc/index.html?slavoroi commentedon Oct 28, 2019
What is the status with this ticket?
It will be amazing if we could have an option:
Or
And it will add the styles in the index.html inline in the head with
ng build ---prod.
naveedahmed1 commentedon May 29, 2020
I would also suggest adding
inlineandpreloadoptions in styles inangular.jsonfileWith above settings, Angular CLI should inline the contents of
critical-path-styles.scssin head tag, and it should generate<link href="/lazy-styles.96106fab.css" rel="preload" as="style" onload="this.rel='stylesheet'">forlazy-styles.scss.spock123 commentedon Oct 25, 2020
Hi, is there any hope of this ever becoming a feature?
Running lighthouse tests just gives red lights all over because of this. It's a pretty common thing to inline resources and it would be a great cli feature.
I would add that inlining the main bundle would also be a great feature.
Thanks again
alan-agius4 commentedon Oct 25, 2020
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.
spock123 commentedon Oct 25, 2020
Yeah I actually heard @mgechev mention it on the latest Angular podcast - I'm so happy - this is YUUGE guys!
Thank you so much
feat(@angular-devkit/build-angular): enable inlining of critical CSS …
naveedahmed1 commentedon Dec 4, 2020
Amazing work @alan-agius4 @clydin 👍
spock123 commentedon Dec 5, 2020
I'm gonna pour myself a gin/tonic and celebrate this. Thank you @alan-agius4 !
angular-automatic-lock-bot commentedon Jan 5, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.