-
Notifications
You must be signed in to change notification settings - Fork 264
/
vue.config.js
36 lines (35 loc) · 1.15 KB
/
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
33
34
35
36
const path = require('path');
const prettier = require('prettier');
module.exports = {
publicPath: '',
chainWebpack: (config) => {
// Worker Loader
config.module
.rule('worker')
.test(/vanity\.js$/)
.use('worker-loader')
.loader('worker-loader')
.options({
inline: 'no-fallback',
filename: 'vanity.js',
})
.end();
},
configureWebpack: {
plugins: process.env.DEPLOY
? [
new (require('prerender-spa-plugin'))({
staticDir: path.join(__dirname, 'dist'),
routes: ['/'],
postProcess(renderedRoute) {
renderedRoute.html = prettier
.format(renderedRoute.html, { filepath: 'index.html', printWidth: 120 })
.replace('render', 'prerender')
.replace(/(data-v-[0-9a-f]+)=""/gm, '$1');
return renderedRoute;
},
}),
]
: [],
},
};