Closed abevoelker closed 2 years ago
Another approach instead of copying the fonts over to app/assets
would be to add the node_modules folder to the Propshaft load path:
# config/initializers/assets.rb
Rails.application.config.assets.paths << Rails.root.join("node_modules/@fortawesome/fontawesome-free")
However that would also make the other files in that directory visible to Propshaft:
$ ls -F node_modules/@fortawesome/fontawesome-free
css/ less/ scss/ svgs/ attribution.js package.json
js/ metadata/ sprites/ webfonts/ LICENSE.txt
Thank you for your work @abevoelker . Personally I didn't already upgraded my projects to rails 7, so I'm glad you've figured it out.
Any time, thanks for the gem! :tada:
I upgraded a Rails app from 6.1 to 7 and to the new Propshaft + CSS Bundling setup and this is the process I followed to get the
fa_icon
helpers working again. I don't know if this is the ideal method but after a little tinkering it's what I came up with that works.