question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extract critical css file with record in manifest.json

See original GitHub issue

How I can extract critical css without any html process. I want extract critical file with hash in the name and emit this file as asset to webpack and save it to manifest.json as file Example:

{
  "app.js": "app.0f15f07046d4.js",
  "app.css": "app.395ff6e90875.css",
  "app.js.map": "app.0f15f07046d4.js.map",
  "app.css.map": "app.395ff6e90875.css.map",
  "vendor.js": "vendor.61b7598213e7.js",
  "vendor.js.map": "vendor.61b7598213e7.js.map",
  "critical.css": "critical.g5h32j4k123.css"
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
romanlexcommented, May 14, 2018

@thescientist13 thx for the answer

1reaction
thescientist13commented, May 14, 2018

@romanlex To build off @anthonygore , I don’t think it’s in the scope of critical either.

My understanding of how critical works is by actually using a headless browser to render your page and then using the resulting rendering to find the HTML that is “above the fold” and determine the needed CSS from that. So in fact, it requires working off an HTML document.

Per their README

Critical extracts & inlines critical-path (above-the-fold) CSS from HTML

Hope that helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extract critical CSS - web.dev
Learn how to improve render times with critical CSS technique and how to choose the best tool for your project.
Read more >
MiniCssExtractPlugin - webpack
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS...
Read more >
Extend site information page to generate a manifest.json file
While working on the progressive web app module I came across a W3C draft for a manifest file. This file is used on...
Read more >
Webpacker can't find application.css in /app/public/packs ...
Seems to be missing a application.css from the manifest.json file in /app/public/packs/manifest.json. I think my manifest.json is not accurate ...
Read more >
Critical CSS with Rails and Webpacker - SprocketsLess Part 1
js and critical.scss which then appear in my manifest.json. I've set extract_css: true in wepbacker.yml. However i never get any files written ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found