]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update docs example on how to optimize JavaScript bundle
authorPascal Pepe <contact@pascalpepe.fr>
Fri, 19 Jun 2020 08:34:30 +0000 (11:34 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 20 Oct 2020 08:17:06 +0000 (11:17 +0300)
site/content/docs/5.0/customize/optimize.md

index 646c0e6e4819721914a75551cbd2af8b56aedb77..358fe86b7320fab93899528c54ed0289987248e0 100644 (file)
@@ -24,14 +24,20 @@ For instance, assuming you're using your own JavaScript bundler like Webpack or
 ```js
 // Import just what we need
 
-// If you're importing tooltips or popovers, be sure to include the Popper.js dependency
-// import "../../node_modules/popper.js/dist/popper.min.js";
-
-import "../../node_modules/bootstrap/js/dist/util.js";
-import "../../node_modules/bootstrap/js/dist/modal.js";
+// import "bootstrap/js/dist/alert";
+// import "bootstrap/js/dist/button";
+// import "bootstrap/js/dist/carousel";
+// import "bootstrap/js/dist/collapse";
+// import "bootstrap/js/dist/dropdown";
+import "bootstrap/js/dist/modal";
+// import "bootstrap/js/dist/popover";
+// import "bootstrap/js/dist/scrollspy";
+// import "bootstrap/js/dist/tab";
+// import "bootstrap/js/dist/toast";
+// import "bootstrap/js/dist/tooltip";
 ```
 
-This way, you're not including any JavaScript you don't intend to use for components like buttons, carousels, and tooltips.
+This way, you're not including any JavaScript you don't intend to use for components like buttons, carousels, and tooltips. If you're importing dropdowns, tooltips or popovers, be sure to list the Popper.js dependency in your `package.json` file.
 
 ## Autoprefixer .browserslistrc