-
Notifications
You must be signed in to change notification settings - Fork 18
/
vue.config.js
49 lines (46 loc) · 1.32 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
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path');
const fs = require('fs');
const gaTempHTML = fs.readFileSync(path.join(__dirname, './template/ga.html'));
const sessionData = require(path.join(__dirname, './public/json/session.json'));
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '/2020/' : '/',
pluginOptions: {
prerenderSpa: {
registry: undefined,
renderRoutes: [
'/2020/',
'/2020/cfp',
'/2020/cfp/',
'/2020/agenda',
'/2020/agenda/',
...sessionData.sessions.map(session => (`/2020/agenda/${session.id}`)),
...sessionData.sessions.map(session => (`/2020/agenda/${session.id}/`)),
'/2020/activity',
'/2020/activity/',
'/2020/venue',
'/2020/venue/',
'/2020/traffic',
'/2020/traffic/',
'/2020/team',
'/2020/team/',
'/2020/sponsor',
'/2020/sponsor/',
'/2020/team/staff',
'/2020/team/staff/',
'/2020/covid-19',
'/2020/covid-19/',
],
useRenderEvent: true,
headless: true,
onlyProduction: true,
postProcess: route => {
// Auto inject GA template
route.html = route.html.replace(
'<noscript>{{{ %GA_TEMPLATE% }}}</noscript>',
gaTempHTML
);
return route;
}
}
}
};