Important! This guide is out of date (circa 2017) and should no longer be used. For the latest advice, please refer to the BootstrapVue docs and their Nuxt.js module. https://bootstrap-vue.org/docs#nuxt-js
General setup:
-
Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader)
npm install --save-dev [email protected] node-sass sass-loader
-
Install nuxt plugin of bootstrap vue (includes bootstrap-vue as a dependency)
npm install @nuxtjs/bootstrap-vue
-
Register plugin as module in nuxt.config.js (see below)
-
Create app.scss entry point (see below)
-
Add app.scss entry point file to
css
setting in nuxt.config.js (see below) -
Configure postcss:
- Create a postcss.config.js file next to package.json (repo root) (see below)
- Update package.json with supported browsers list as per what bootstrap or yourself use (see below)
- Install those plugins for dev build:
npm install --save-dev precss autoprefixer
Optimizations:
- Use app2.scss to only import css you need.
- Don't use module registration/plugin installer, simply call Vue.component/Vue.directive on things you want, or even just load per component in your own components as needed with import.
@slidenerd, in your case you don't need bootstrap-vue. This guide is for those that are using bootstrap-vue as their component library.