CentreForDigitalHumanities / Vue-lib

A set of re-usable Vue components and composables
European Union Public License 1.2
0 stars 0 forks source link

Injecting Bootstrap JS #1

Open tymees opened 1 year ago

tymees commented 1 year ago

Some components use Bootstrap for some interactive functionality. However, getting the js inside a Vue component is somewhat tricky.

If it's directly imported, the entire BS-JS gets bundled in, which breaks any apps already supplying their own version. (Not to mention the inflated bundle size). To complicate matters, not every app provided Bootstrap in the same way; some just load in the JS file in the HTML head, others import as a Vue plugin.

I'm not entirely sure how to approach this, I'll need a good testcase for both usecases. I have one for the first, but the second might be tricky.

Hopefully just marking it as external dep in Vite works.

tymees commented 1 year ago

Currently the Modal component is not exported during build for this reason