Replies: 3 comments 2 replies
-
For what its worth I actually figured out how to do it and compile it (although I haven't found anything about this in the docs so its not as straightforward)
And now the bundle you want will be inside dist/js/bootstrap.bundle.min.js This bs js only has the Carousel javascript now, and you can include it normally in a non webpack project <script src="bundle.js"> etc... It would help a ton if this is explained more clearly in the docs, stressing this again, you can't just use the /src js files since they contain import statements ( in bs4 you could do that ) |
Beta Was this translation helpful? Give feedback.
-
It seems we no longer build util separately in v5. @Johann-S any ideas why? Not sure if it was intentional? |
Beta Was this translation helpful? Give feedback.
-
I was caught off-guard updating from bootstrap 4 to 5 because I used to import
Bootstrap 5 just doesn't mention it at all, most notably not even in the migration guide. I dunno if it's too late to do so but adding a note about it there would be awesome. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let me clarify.
I work on a wordpress project, I don't have access to any compilers like webpack or able to use import.
I'm trying to transition to bs5. However, one thing I liked about BS4 is that if I need scrollspy just in a certain template, I can add util.js + scrollspy.js and mimify them. This gives me a 9kb JS file. vs the 83kb file that is the V4.6 bundle. I'm trying to optimize my site as much as possible.
How can I do this in bs5? I know if I use webpack I can use export and what not but I don't have access to these ES5 rules in normal javascript.
On the documentation it says "Plugins can be included individually (using Bootstrap’s individual js/dist/*.js), or all at once using bootstrap.js or the minified bootstrap.min.js (don’t include both)."
I tried including modal.js from dist and it says "Uncaught SyntaxError: Cannot use import statement outside a module".
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions