Import bootstrap-sass in vuejs

Reading Time: < 1 minute


1) yarn add bootstrap bootstrap-sass node-sass sass-loader

yarn add boostrap bootstrap-sass node-sass sass-loader

2) Set $icon-font-path to find font files and import variable.scss and _bootstrap.scss

$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/variables";
@import "~bootstrap-sass/assets/stylesheets/_bootstrap.scss";

3) In main.js, require(‘./assets/sass/main.scss’);
4) type yarn serve to launch application in development mode. Index page should open at url http://localhost:8080.

yarn serve

// add any variables you want to override here
// ———
// ———
$icon-font-path: ‘~bootstrap-sass/assets/fonts/bootstrap/’;
@import ‘~bootstrap-sass/assets/stylesheets/bootstrap’;