The newest Rails release 5.1.0.rc1 includes bin/yarn by default. This allows you to install npm modules out of the box. Currently importing javascript files from application.js seems to work fine, but I haven't been able to import css files from the installed modules.
The approach I've tried is using the tilde opperator to let SASS know that it's suppose to be a module:
@import "~owlcarousel-pre/owl-carousel/owl.carousel";
Any ideas on how to get this working?
I was able to get it working by removing the tilde operator.
@import "owlcarousel-pre/owl-carousel/owl.carousel";
Apparently I got mislead by the linting options on my editor that insisted on putting it, but the asset pipeline includes the modules for you so there's no need to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With