forked from bootstrap-vue/bootstrap-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
74 lines (63 loc) · 1.89 KB
/
nuxt.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const path = require('path');
const fs = require('fs');
const marked = require('marked');
// Markdown renderer with BS4 tables support
const renderer = new marked.Renderer();
const originalTable = renderer.table
renderer.table = function renderTable(header, body) {
let r = originalTable.apply(this, arguments)
return r.replace('<table>', '<table class="table b-table table-striped">')
}
module.exports = {
srcDir: path.resolve(__dirname, 'docs/nuxt'),
build: {
extractCSS: true,
extend(config) {
config.resolve.alias['vue'] = 'vue/dist/vue.common'
config.module.rules.push({
test: /\.md$/,
use: [
{ loader: 'html-loader' },
{ loader: 'highlight-loader' },
{ loader: 'markdown-loader', options: { renderer } }
]
});
}
},
loading: {
color: '#59cc93'
},
manifest: {
name: 'Bootstrap Vue',
description: 'Bootstrap 4 Components for Vue.js 2',
theme_color: '#464646'
},
generate: {
dir: 'docs-dist',
routes: () => {
let scan = dir => fs.readdirSync(`docs/${dir}`)
.filter(c => c !== 'index.js' && c[0] !== '_')
.map(component => `/docs/${dir}/${component}`);
return []
.concat(scan('components'))
.concat(scan('directives'))
}
},
plugins: [
'~plugins/bootstrap-vue.js',
'~plugins/codemirror.js',
'~plugins/ga.js',
'~plugins/play.js',
'~/plugins/docs.js'
],
modules: [
'@nuxtjs/pwa'
],
css: [
'bootstrap/dist/css/bootstrap.css',
'highlightjs/styles/github-gist.css',
'codemirror/lib/codemirror.css',
'~assets/css/docs.min.css',
'~assets/css/styles.css'
]
};