This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
vue.config.js
51 lines (48 loc) · 1.7 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
50
51
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" ? "/2021/" : "/",
pluginOptions: {
prerenderSpa: {
registry: undefined,
renderRoutes: [
'/2021/',
'/2021/cfp',
'/2021/cfp/',
'/2021/cfp/news',
'/2021/cfp/news/',
'/2021/cfp/ocfp-news',
'/2021/cfp/ocfp-news/',
'/2021/agenda',
'/2021/agenda/',
...sessionData.sessions.map((session) => `/2021/agenda/${session.id}`),
...sessionData.sessions.map((session) => `/2021/agenda/${session.id}/`),
'/2021/venue',
'/2021/venue/',
'/2021/traffic',
'/2021/traffic/',
'/2021/team',
'/2021/team/',
'/2021/sponsor',
'/2021/sponsor/',
...sessionData.rooms.map((room)=>`/2021/slido/${room.id.toLowerCase()}`),
...sessionData.rooms.map((room)=>`/2021/record/${room.id.toLowerCase()}`),
...sessionData.rooms.map((room)=>`/2021/slido/${room.id.toLowerCase()}/`),
...sessionData.rooms.map((room)=>`/2021/record/${room.id.toLowerCase()}/`)
],
useRenderEvent: true,
headless: true,
onlyProduction: true,
postProcess: (route) => {
// Auto inject GA template
route.html = route.html.replace(
"<noscript>{{{ %GA_TEMPLATE% }}}</noscript>",
route.route === '/2021/' ? gaTempHTML + '<link rel="canonical" href="https://sitcon.org/2021/" />' : gaTempHTML
);
return route;
}
},
},
};