This is the dummy project setup: React on Vite, Bootstrap w/ sass.
The goal: demonstrate the folder structure.
-
Setup the React project w/ Vite in the same folder:
npm create vite@latest ./
-
Add Bootstrap to the project
npm install bootstrap
- add a link in the
main.jsx
file to the whole library:import 'bootstrap/dist/css/bootstrap.css'
; This link must appear before any own css styling.
-
Install
sass
in version 1.64.2:npm install [email protected]
-
Create a folder and a file for styles with sass in
src
folder of the project:./src/styles/styles.scss
-
In
styles.scss
file import the Bootstrap:
@import "bootstrap/scss/bootstrap.scss";
Check documentation for extended instructions: (https://getbootstrap.com/docs/5.3/getting-started/vite/#import-bootstrap)[https://getbootstrap.com/docs/5.3/getting-started/vite/#import-bootstrap]
- Import the style file in
main.jsx
:import "./styles/styles.scss"
No extra watch processes is needed for .scss
files.