Possible to use with import maps? #150
-
Is it possible to use Ruby2JS with importmap-rails? I see instructions for Rails 7 using jsbundling, but I'm wondering if it's possible to do the same if my app uses an import map. It's a simple app, and I don't want to move up from import maps if I don't need to. I'm pretty new to Rails, and web apps generally, so forgive me if this is a no-brainer. I've just discovered this project today and I'm so excited at the prospect of writing Ruby on the frontend 🤩 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm excited you're excited! 😊 So the importmap stuff I believe is a way to import 3rd party JS modules…it doesn't address any build step for the code you yourself would write. You could use the new Ruby2JS CLI to output JS files to a place where the asset pipeline picks them up. Barring that, I'm not sure if the Sprockets integration works anymore TBH. I'd much rather recommend using a loader for Webpack or another "jsbundling" option like Rollup. |
Beta Was this translation helpful? Give feedback.
I'm excited you're excited! 😊
So the importmap stuff I believe is a way to import 3rd party JS modules…it doesn't address any build step for the code you yourself would write.
You could use the new Ruby2JS CLI to output JS files to a place where the asset pipeline picks them up. Barring that, I'm not sure if the Sprockets integration works anymore TBH. I'd much rather recommend using a loader for Webpack or another "jsbundling" option like Rollup.