hanami / ujs

Hanami UJS
4 stars 2 forks source link

Can't use with Webpack #6

Closed DannySantos closed 4 years ago

DannySantos commented 4 years ago

I haven't been able to figure out how to serve the hanami-ujs library using Webpack, the docs currently assume you are using Hanami::Assets.

I'm currently trying to get Hanami working with StimulusJS, and they seem to have come up with a method of optionally serving their assets using Webpack:

https://github.com/stimulusjs/stimulus/tree/6946174b07b8891c8fab0ef7509842d950741c34/packages/%40stimulus/webpack-helpers

I can't figure out exactly how they're doing it, but thought I'd raise the issue in case implementing something similar here is of interest to anyone.

cllns commented 4 years ago

This project bundles up the vanilla-ujs code for use with Hanami::Assets. If you want to go with webpack instead of Hanami::Assets, then you don't need this gem :) Instead, looking to getting vanilla-ujs itself.

Closing this as I'm pretty sure this will solve your problem, but feel free to open it again if needed. 🌸