app/javascripts/packs/application.js
not workingstylesheets_pack_tag
in views/layout/application.html, but no effect, no <link>
generated. why? Seems to be a Rails6.1.3/webpacker5.0 bugextract_css=false
setting in config/webpacker.yml
, so all css are embed in the HTML. In production, the css is extracted, put in a separated file public/packs/css/applicationxxx.css
. However, it's not included in html, so not work. assets/stylesheets/application.scss
@import 'select2/dist/css/select2.min';
instead of @import 'select2/dist/css/select2.min.css';
. The later cases works in development, but the file is empty in production. I guess because Rails production doesn't know the local directory of node_modules. The former case works, as the css is copied to application.css, instead of a separated file.