How to import bootstrap into vite projects?


by mac , in category: Javascript , a month ago

How to import bootstrap into vite projects?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by arnoldo.moen , a month ago


To import Bootstrap into your Vite project, you can follow these steps:

  1. Install Bootstrap and its peer dependencies:
npm install bootstrap@latest

  1. Import the Bootstrap CSS file in your main.js or App.vue file:
import 'bootstrap/dist/css/bootstrap.min.css';

  1. You can also import Bootstrap JavaScript files if needed:
import 'bootstrap/dist/js/bootstrap.min.js';

  1. Restart your Vite development server to apply the changes.

That's it! You have now successfully imported Bootstrap into your Vite project. You can start using Bootstrap classes and components in your project.