Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Importing JavaScript instruction incorrect for all plugins #34673

Closed
mariusa opened this issue Aug 4, 2021 · 4 comments · Fixed by #34840
Closed

[docs] Importing JavaScript instruction incorrect for all plugins #34673

mariusa opened this issue Aug 4, 2021 · 4 comments · Fixed by #34840

Comments

@mariusa
Copy link
Contributor

mariusa commented Aug 4, 2021

https://getbootstrap.com/docs/5.0/getting-started/webpack/ says

Importing JavaScript
Import Bootstrap’s JavaScript by adding this line to your app’s entry point (usually index.js or app.js):

// You can specify which plugins you need
import { Tooltip, Toast, Popover } from 'bootstrap';

Alternatively, if you only need just a few of our plugins, you may import plugins individually as needed:

The 1st section should go into 2nd section, and 1st should specify how to import all plugins:

Importing JavaScript
Import Bootstrap’s JavaScript by adding this line to your app’s entry point (usually index.js or app.js):
import * from 'bootstrap'; // TODO don't know which is the correct import for all plugins


Alternatively, if you only need just a few of our plugins, you may import plugins individually as needed:
// You can specify which plugins you need
import { Tooltip, Toast, Popover } from 'bootstrap';
@GeoSot
Copy link
Member

GeoSot commented Aug 28, 2021

Please @mariusa can you check the proper way to import all plugins and make an MR with your suggestions?

@mariusa
Copy link
Contributor Author

mariusa commented Aug 29, 2021

Hi, I don't know which is the correct way to import all plugins with a single line. Could a dev point out how?

@twbs twbs deleted a comment Aug 29, 2021
@GeoSot
Copy link
Member

GeoSot commented Aug 30, 2021

Little help 😃

import 'bootstrap';

// or

import * as Bootstrap from 'bootstrap';

@mariusa
Copy link
Contributor Author

mariusa commented Aug 30, 2021

Done. I left 2nd section alone, as I realize it refers to importing specific plugins from specific file. Don't know what's the benefit, as I thought the build process will include only used plugins, even if all are imported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@mariusa @GeoSot and others