- Install the following in
assets
:
npm install --save bootstrap jquery popper.js
npm install --save-dev [email protected] node-sass
- Rename
assets/app.css
to assets/app.scss
- Edit
webpack.config.js
to add sass-loader
and enable scss
compilation:
test: /\.(scss|css)$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
- Import bootstrap to
app.scss
:
@import '../node_modules/bootstrap/scss/bootstrap';
- Import bootstrap in
app.js
and rename app.css
to app.scss
:
import css from "../css/app.scss"
import "bootstrap"