mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
Update docs example on how to optimize JavaScript bundle
This commit is contained in:
parent
c85e863536
commit
9cc24cf549
@ -24,14 +24,20 @@ For instance, assuming you're using your own JavaScript bundler like Webpack or
|
|||||||
```js
|
```js
|
||||||
// Import just what we need
|
// Import just what we need
|
||||||
|
|
||||||
// If you're importing tooltips or popovers, be sure to include the Popper.js dependency
|
// import "bootstrap/js/dist/alert";
|
||||||
// import "../../node_modules/popper.js/dist/popper.min.js";
|
// import "bootstrap/js/dist/button";
|
||||||
|
// import "bootstrap/js/dist/carousel";
|
||||||
import "../../node_modules/bootstrap/js/dist/util.js";
|
// import "bootstrap/js/dist/collapse";
|
||||||
import "../../node_modules/bootstrap/js/dist/modal.js";
|
// 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
|
## Autoprefixer .browserslistrc
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user