All threads / Esbuild
Ask A Question


You’re not receiving notifications from this thread.


Mountaindog asked in Rails

I'm trying to get away from Webpacker... Installed the gem JSBundling on a Rails 6.0.1.x app, followed the setup procedures to use EsBuild, and it worked. Got BootStrap 5 working with the guidance from your screencast. Thanks! Installed bootstrap icons with Yarn. Added: @import bootstrap-icons/font/bootstrap-icons to my application.bootstrap.scss file. Fired up the dev server - bin/dev - works perfectly. Icons!!! When I test in the production setting (rails s -e production), it's broken. I've tried RAILS_ENV=production rake assets:precompile`` without any success. It does work if I change this config setting in the Config -> Environment -> Production config.assets.compile = false ``` to true. Thoughts on how to remedy this?

I noticed the sassc-rails gem will enable itself in production if there is no css_compressor set. You might set css_compressor = nil and see if that fixes it.

Thanks, Chris. Tried setting config.assets.css_compressor = :sass to nil and no luck. Even tried enabling the:sass option, recompiled the app. No luck. I noticed this is happening with another Yarn package I'm using that has images (SVG) in the node_modules dir. I'm wondering if something should be added to the file?

What it looks like is any sort of "image (jpg, SVG, maybe fonts, etc...)" reference in a CSS file, for example, background-image URL("someimage.jpg") is not being picked up / path issue.?. Hence why Bootstrap Icons are not working.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 69,840+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.