re: Critical CSS with Rails and Webpacker - SprocketsLess Part 1 VIEW POST


Hi Adrien

Thanks for this. I've added the critical.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 to my public/packs directory so the inline read call can't open the extracted file name.

I assume i need to run "rake webpacker:compile" on every change to write to the packs directory? Did you ever find a way around this?

Thanks again


Hi Chris

I did run into issues in development when using overmind to start my Procfil.dev.

Starting my server with a basic rails s did solve this issue.
In production I never had any issue (I deploy to Heroku).

I never do a rake webpacker:compile here on my side


Thanks Adrien

I'm using foreman so perhaps thats something to do with it

currently my public/packs folder is empty

well in development it is normal to have public/packs empty.
Assets are lives served by webpack-dev-server

Code of Conduct Report abuse