I'm using Meteor-Svelte-Bootstrap combination for a project and I can't make the bootstrap's javascript plugins to work.
I have standard Meteor 1.12.1 + Svelte 3 app structure (very similar to this one), bootstrap 5.0.0-beta1 installed as a node module via meteor npm. I'm importing the bootstrap.scss via @import in my client/main.scss file:
@import "../node_modules/bootstrap/scss/bootstrap.scss";
So far everything works fine. But I can't find the correct way of importing the bootstrap javascript plugins needed for some components (as for instance collapsible navbar).
I tried all the following without success:
<script src="...">in myclient/main.html, where as the src attribute I tried all the -node_modules/bootstrap/dist/js/bootstrap*.jsfiles, and the CDN https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js linkThe same inside
<svelte:head>element in myimports/ui/App.sveltecomponent (I'm trying to use the bootstrap javascript directly in this component)<svelte:head> <script src="..."></script> </svelte:head>import 'bootstrap';inside the<script>element of myimports/ui/App.sveltecomponentimport 'bootstrap';inside myclient/main.jsfileand probably some more...
None of these works. When I'm trying to import node_modules/bootstrap/dist/js/bootstrap*.js files, I get a syntax error on the first character of the imported file (weird). When I'm using CDN or import bootstrap, no error is shown but the bootstrap javascript doesn't work.
Can someone suggest the correct way of doing this? Thanks.