-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
34 lines (32 loc) · 863 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
const path = require("path");
const PrerenderSpaPlugin = require("prerender-spa-plugin");
const CompressionPlugin = require("compression-webpack-plugin");
const productionPlugins = [
new PrerenderSpaPlugin({
staticDir: path.join(__dirname, "docs"),
routes: ["/"],
renderer: new PrerenderSpaPlugin.PuppeteerRenderer({
inject: {},
headless: true,
renderAfterDocumentEvent: "render-event",
}),
}),
];
module.exports = {
publicPath: "./",
outputDir: "docs",
pluginOptions: {
webpackBundleAnalyzer: {
openAnalyzer: false,
},
},
configureWebpack: (config) => {
if (process.env.NODE_ENV === "production") {
config.plugins.push(...productionPlugins);
}
},
chainWebpack(config) {
config.plugins.delete("prefetch");
config.plugin("CompressionPlugin").use(CompressionPlugin);
},
};