Table of contents
When Rails app is running, it incorrectly searches for stylesheets in the
app/assets/stylesheets instead of the intended
This situation is likely due to the default asset pipeline configuration.
However, if you want to centralize your stylesheets in the
Check Webpacker installation
npm list | grep webpacker
calaca@calaca-PC ~/var/www/edume (courses-initial-configuration)$ npm list | grep webpacker ├── @firstname.lastname@example.org
bundle list | grep webpacker
calaca@calaca-PC ~/var/www/edume (courses-initial-configuration)$ bundle list | grep webpacker The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. * webpacker (5.4.4)
Open the webpacker.yml file
The file is located in
UPdate the source_path
You file should look something like the following
Restart the Webpacker server
In your terminal emulator:
Import stylesheets into application.js
Or with the following syntax:
It'll look something like this:
Create an index file
This file will serve as an entry point for your SCSS imports.
Include all imports
@import 'application'; @import 'courses';
Check the result
You've made it!
Let's become friends
I hope this article has been helpful to you. Please feel free to reach out if you have any questions. Your thoughts, suggestions, and corrections are more than welcome.
By the way, don't hesitate to drop your suggestions for new blog articles.
I look forward to seeing you next time.