Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

How do you figure out what and how to load the css/scss assets with Webpacker

Rails • Asked by Greg S

For Bootstrap you added to application.scss(I may have named my folder differently:

import "bootstrap"
import 'bootstrap/dist/js/bootstrap'


@import '../css/bootstrap_custom';
@import "~bootstrap/scss/bootstrap";  // the tilde seems to be optional?

I reverse engineering this for an OpenLayers' module but the directory structures don't seem to follow a pattern and I plan to add other OpenLayers modules and wondered if how one knows what to add where? Although adding to application.js seem to work but javascript/css/application.scss is more logical.

gems were easier, but none current is available for OpenLayers. Seems to me application.js file should be in javascripts not buried in packs. Maybe I need a primer on Webpack.

Thank you for the great web casts.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,242+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.