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',
|
2019-12-08 04:02:22 +08:00
|
|
|
port: 3000,
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
use: '@gridsome/vue-remark',
|
|
|
|
options: {
|
|
|
|
typeName: 'Post',
|
2020-04-18 18:48:20 +08:00
|
|
|
baseDir: './src/data/posts',
|
|
|
|
route: '/:slug',
|
2019-12-08 04:02:22 +08:00
|
|
|
template: './src/templates/Post.vue',
|
|
|
|
plugins: [
|
|
|
|
'@gridsome/remark-prismjs',
|
|
|
|
[
|
|
|
|
'@noxify/gridsome-plugin-remark-embed',
|
|
|
|
{
|
|
|
|
'enabledProviders' : ['Youtube', 'Twitter', 'Gist'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
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
|
|
|
}
|