rails6 导入js依赖库css样式

mfkpum 2020-06-05

If you have upgraded your app from an earlier version of Rails make sure you add the following line:

 Rails.application.config.assets.paths << Rails.root.join(‘node_modules‘) in config/initializers/assets.rb.

This is included by default in the newly generated apps.

Then in 

app/javascripts/packs/application.sass the following should do the job:
@import ‘font-awesome/css/font-awesome‘; (no ~ and no file extension)

相关推荐