forked from reel2bits/reel2bits.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
43 lines (42 loc) · 1012 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
33
34
35
36
37
38
39
40
41
42
43
const locales = require("./src/locales");
const path = require("path");
const PrerenderSPAPlugin = require("prerender-spa-plugin");
module.exports = {
baseUrl: process.env.VUE_APP_ROUTER_BASE_URL || "/",
chainWebpack: config => {
config.plugins.delete("prefetch");
},
configureWebpack: () => {
if (process.env.NODE_ENV !== "production") return;
let baseRoutes = [
"/",
"/code-of-conduct",
"/community",
"/contact",
"/apps",
"/collective",
"/logos",
"/support-us"
];
let finalRoutes = [];
baseRoutes.forEach(p => {
finalRoutes.push(p);
locales.locales.forEach(l => {
finalRoutes.push("/" + l.code + p);
});
});
return {
plugins: [
new PrerenderSPAPlugin(
// Absolute path to compiled SPA
path.resolve(__dirname, "dist"),
// List of routes to prerender
finalRoutes,
{
// options
}
)
]
};
}
};