Verified Commit 8947c0ac authored by Agate's avatar Agate 💬

Installed and configure prerender-spa-plugin

parent b4069e03
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 = ["/", "/about"];
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
}
)
]
};
},
lintOnSave: false
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment