New Discussion

Notifications

You’re not receiving notifications from this thread.

How to troubleshoot esbuild in Rails 7

0
Rails

With the arrival of Rails 7.0, i have tried moving from webpack to esbuild but struggle with it.

I know that theoretically, creating a file jquery.js and importing it in application.js
import jquery from “jquery”
window.jQuery = jquery window.$ = jquery

Should make $ available in the views… but sometimes it doesn't but i have no idea why (even if esbuild compiles successfully) Any idea how to troubleshoot this?

I have noticed for example that I need to put a carriage return after the last line in jquery.js... if I don't, I dont have any error message in the console the the .map is not generated

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.