Permalink
Browse files

feat(packaging): add nuxt module

Easier usage and always updated with currently installed version of bootstrap-vue
  • Loading branch information...
pi0 committed Oct 26, 2017
1 parent fa468fb commit 4c58c80e61322cee9cbfa2d37bfe07240ba03d72
Showing with 39 additions and 1 deletion.
  1. +33 −0 nuxt/index.js
  2. +4 −0 nuxt/plugin.js
  3. +2 −1 package.json
@@ -0,0 +1,33 @@
/*
Nuxt.js module for bootstrap-vue
Usage:
- Install both bootstrap and bootstrap-vue packages
- Add this into your nuxt.config.js file:
{
modules: [
'bootstrap-vue/nuxt'
]
}
*/
const { resolve } = require('path')
module.exports = function nuxtBootstrapVue (moduleOptions) {
// Conditionally require bootstrap original css too if not explicitly disabled
if (moduleOptions.css !== false) {
this.options.css.unshift('bootstrap/dist/css/bootstrap.css')
}
// Register plugin
this.addPlugin({
src: resolve(__dirname, 'plugin.js'),
fileName: 'bootstrap-vue.js',
moduleOptions
})
// Add library styles
this.options.css.push('bootstrap-vue/dist/bootstrap-vue.css')
}
module.exports.meta = require('./package.json')
@@ -0,0 +1,4 @@
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
Vue.use(BootstrapVue)
@@ -44,7 +44,8 @@
},
"files": [
"lib",
"dist"
"dist",
"nuxt"
],
"scripts": {
"build": "build/build",

0 comments on commit 4c58c80

Please sign in to comment.