DEV Community

loading...

Discussion on: Critical CSS with Rails and Webpacker - SprocketsLess Part 1

Collapse
chrissmith288 profile image
chrissmith288

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

Collapse
adrienpoly profile image
Adrien Poly Author

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

Collapse
chrissmith288 profile image
chrissmith288

Thanks Adrien

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

currently my public/packs folder is empty

Thread Thread
adrienpoly profile image
Adrien Poly Author

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