mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-03-27 09:40:23 +00:00
Update docs example on how to optimize JavaScript bundle
This commit is contained in:
parent
c85e863536
commit
9cc24cf549
1 changed files with 12 additions and 6 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue