Webpacker presents a more difficult OOB experience for JS Sprinkles than Sprockets did

I’m very late to this - but I have to disagree about ‘just works’ I spent many hours trying to add jQuery and Bootstrap to a rails project

there are a bunch of tutorials - many of which give a half-working experience.

(in my case, stuff worked in ujs and console, but not my included js. I didn’t even realise it was half broken until several days into using it)

I don’t know if it is plausible - but for me, what I would like to see would be a js equivalent of bundler

#yarnbundefile.rb
yarnbundle 'jquery' [optionally some version info]
yarnbundle 'bootstrap'

yarnbundle install … and magically it all works

at the moment, I think the process is

  1. yarn install
  2. google how to include in environment.js (it seems to be different for each library)
  3. require (or import?) in application.js
  4. (sometimes) require (or import?) in application.js

thanks

1 Like