vimeshjs / vimesh-ui

Vimesh UI is an ultra lightweight library to build UI components for Alpine.js
MIT License
125 stars 5 forks source link

How to load directives and magic when using npm module. #5

Closed g5becks closed 1 year ago

g5becks commented 1 year ago

Hi, thanks for the great lib. I am attempting to use this library in a bundled that is being built with esbuild.

There is not mention of how to load the directives and magics when importing into a bundle. I tried following the instructions found here, but I couldn't get it to work.

Any help would be highly appreciated.

Thanks.

xinjie-zhang commented 1 year ago

Normally it is not a good practice to bundle Alpinejs. If you are using it with React, Vue or other frameworks, you have to understand most of these frameworks are based on virtual DOM not real DOM. Mix Alpinejs with React/Vue may cause unexpected issue. Anyway, could you share a minimal sample esbuild project of your problem?

g5becks commented 1 year ago

I decided on not bundling in the end. Thanks.