yarn add bootstrap
yarn add jquery popper.js
# app/javascript/packs/application.js
import "jquery";
import "popper.js";
import "bootstrap";
Add a folder name stylesheets in app/javascript/
Add application.scss file in app/javascript/stylesheets
Add below code to import bootstrap css:
# In app/javascript/stylesheets/application.scss
@import "~bootstrap/scss/bootstrap";
Import CSS to application.js
# In app/javascript/packs/application.js
import "../stylesheets/application"
app/javascript
├── channels
├── packs
│ └── application.js
└── stylesheets
└── application.scss
More details in Luanotes.com: https://luanotes.com/blogs/using-bootstrap-with-webpacker-in-rails-6