mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 12:21:35 +02:00
clarify importing all vs specific plugins (#34840)
This commit is contained in:
@@ -15,15 +15,19 @@ toc: true
|
|||||||
Import [Bootstrap's JavaScript]({{< docsref "/getting-started/javascript" >}}) by adding this line to your app's entry point (usually `index.js` or `app.js`):
|
Import [Bootstrap's JavaScript]({{< docsref "/getting-started/javascript" >}}) by adding this line to your app's entry point (usually `index.js` or `app.js`):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// You can specify which plugins you need
|
import 'bootstrap';
|
||||||
import { Tooltip, Toast, Popover } from 'bootstrap';
|
|
||||||
|
// or get all of the named exports for further usage
|
||||||
|
import * as bootstrap from 'bootstrap';
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, if you only need just a few of our plugins, you may **import plugins individually** as needed:
|
Alternatively, if you only need just a few of our plugins, you may **import plugins individually** as needed:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import Alert from 'bootstrap/js/dist/alert';
|
import Alert from 'bootstrap/js/dist/alert';
|
||||||
...
|
|
||||||
|
// or, specify which plugins you need:
|
||||||
|
import { Tooltip, Toast, Popover } from 'bootstrap';
|
||||||
```
|
```
|
||||||
|
|
||||||
Bootstrap depends on [Popper](https://popper.js.org/), which is specified in the `peerDependencies` property.
|
Bootstrap depends on [Popper](https://popper.js.org/), which is specified in the `peerDependencies` property.
|
||||||
|
Reference in New Issue
Block a user