-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
32 lines (29 loc) · 963 Bytes
/
vue.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
const path = require('path')
const PrerenderSPAPlugin = require('prerender-spa-plugin')
module.exports = {
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.tap(args => {
// stupid workaround to prevent vue loader from stripping
args.compilerOptions.whitespace = 'preserve'
})
},
configureWebpack: {
plugins: []
}
}
if (process.env.NODE_ENV == 'production') {
module.exports.configureWebpack.plugins.push(new PrerenderSPAPlugin({
// Required - The path to the webpack-outputted app to prerender.
staticDir: path.join(__dirname, 'dist'),
// Required - Routes to render.
routes: ['/', '/work-history'],
postProcess(renderedRoute) {
renderedRoute.html = renderedRoute.html.replace(/v_cloak/g, "v-cloak")
renderedRoute.html = renderedRoute.html.replace(/jared\@kravse\.dev/g, `Jared AT kravse DOT dev`)
return renderedRoute
},
}))
}