-
Notifications
You must be signed in to change notification settings - Fork 3
/
vue.config.js
30 lines (27 loc) · 994 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
const path = require('path')
const PrerenderSPAPlugin = require('prerender-spa-plugin')
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
return {
plugins: [
new PrerenderSPAPlugin({
staticDir: path.join(__dirname, 'dist'),
routes: ['/react-vs-vue'],
renderer: new Renderer({
inject: {
headless: true,
},
// @see https://github.com/chrisvfritz/prerender-spa-plugin/issues/200#issuecomment-391204354
// REMOVED headless: false,
// @see https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-fails-due-to-sandbox-issues
args: ['--no-sandbox', '--disable-setuid-sandbox'],
renderAfterDocumentEvent: 'render-event',
}),
}),
],
}
}
},
}