/packs Is a special folder that contains the entry points to your "modules" (webpacker will bundle up each file inside /packs with its dependencies into single file).
So, If you have packs/application.js it will be bundled up with its dependencies and become available as example.com/packs/js/application-[hash].js (Find that in the <head> of your website).
If you check your deployment, you will find example.com/packs/stylesheets-[hash].css which is basically useless because your styles are already bundled to example.com/packs/css/application-[hash].css because of the import './stylesheets.css' you have in app/javascript/packs/application.js already.
Having stylesheets.css inside packs might be just "useless" now. But, It might pile up with time or you might even have your React src folder inside there which basically mean you will have webpacker compiling your app in a loop that might cause 40+ minutes when deploying (I learned the hard way 😅).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't think you should put
stylesheets.css
inside/packs
folder, It will be considered a "pack" and will be compiled tostylesheets-[hash].js
.Can you elaborate, please? I do this bc it’s the “rails way” a typically only find pain when I stray from this path. What do you prefer to do?
/packs
Is a special folder that contains the entry points to your "modules" (webpacker will bundle up each file inside/packs
with its dependencies into single file).So, If you have
packs/application.js
it will be bundled up with its dependencies and become available asexample.com/packs/js/application-[hash].js
(Find that in the<head>
of your website).If you check your deployment, you will find
example.com/packs/stylesheets-[hash].css
which is basically useless because your styles are already bundled toexample.com/packs/css/application-[hash].css
because of theimport './stylesheets.css'
you have inapp/javascript/packs/application.js
already.Having
stylesheets.css
insidepacks
might be just "useless" now. But, It might pile up with time or you might even have your Reactsrc
folder inside there which basically mean you will have webpacker compiling your app in a loop that might cause 40+ minutes when deploying (I learned the hard way 😅).