mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-06 04:08:22 +01:00
change how bootstrap can be imported in bundlers
This commit is contained in:
parent
b1b5e87d65
commit
bff1c3a53d
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
title: Webpack
|
title: Webpack and bundlers
|
||||||
description: Learn how to include Bootstrap in your project using Webpack.
|
description: Learn how to include Bootstrap in your project using Webpack or other bundlers.
|
||||||
group: getting-started
|
group: getting-started
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
@ -15,13 +15,14 @@ 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`):
|
||||||
|
|
||||||
{{< highlight js >}}
|
{{< highlight js >}}
|
||||||
import 'bootstrap';
|
// You can specify which plugins you need
|
||||||
|
import { Tooltip, Toast, Popover } from 'bootstrap';
|
||||||
{{< /highlight >}}
|
{{< /highlight >}}
|
||||||
|
|
||||||
Alternatively, 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:
|
||||||
|
|
||||||
{{< highlight js >}}
|
{{< highlight js >}}
|
||||||
import 'bootstrap/js/dist/alert';
|
import Alert from 'bootstrap/js/dist/alert';
|
||||||
...
|
...
|
||||||
{{< /highlight >}}
|
{{< /highlight >}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user