2020-03-06 18:59:36 +08:00
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
function addStyleResource(rule) {
|
|
|
|
rule.use('style-resource')
|
|
|
|
.loader('style-resources-loader')
|
|
|
|
.options({
|
|
|
|
patterns: [
|
|
|
|
path.resolve(__dirname, './src/variables.scss'),
|
|
|
|
],
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-12-08 04:02:22 +08:00
|
|
|
module.exports = {
|
2020-04-18 05:18:18 +08:00
|
|
|
siteName: 'tiptap',
|
2020-04-21 03:01:38 +08:00
|
|
|
titleTemplate: '%s',
|
2019-12-08 04:02:22 +08:00
|
|
|
port: 3000,
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
use: '@gridsome/vue-remark',
|
|
|
|
options: {
|
2020-04-18 23:05:29 +08:00
|
|
|
typeName: 'DocPage',
|
2020-04-18 18:48:20 +08:00
|
|
|
baseDir: './src/data/posts',
|
2020-04-18 23:54:00 +08:00
|
|
|
template: './src/templates/DocPage',
|
2019-12-08 04:02:22 +08:00
|
|
|
plugins: [
|
|
|
|
'@gridsome/remark-prismjs',
|
|
|
|
],
|
2020-04-19 05:00:47 +08:00
|
|
|
remark: {
|
|
|
|
autolinkHeadings: {
|
|
|
|
content: {
|
|
|
|
type: 'text',
|
|
|
|
value: '#'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-04-17 18:55:53 +08:00
|
|
|
},
|
2019-12-08 04:02:22 +08:00
|
|
|
},
|
2020-03-06 18:59:36 +08:00
|
|
|
],
|
|
|
|
chainWebpack(config) {
|
|
|
|
// Load variables for all vue-files
|
|
|
|
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
|
|
|
|
|
|
|
|
types.forEach(type => {
|
|
|
|
addStyleResource(config.module.rule('scss').oneOf(type))
|
|
|
|
})
|
|
|
|
},
|
2019-12-08 04:02:22 +08:00
|
|
|
}
|