From f3ab8bc86bd10e6d7398970db07d91a28485359d Mon Sep 17 00:00:00 2001 From: Derick Montague Date: Tue, 10 Dec 2019 15:13:25 -0600 Subject: Add compression and remove incompatible plugins - Add gzip file compression - Prefetch and preload plugins that add web loading primitives that are not compatible with our server settings - Move port to run dev from script flag to vue config file - Remove sourcemap files from production build Signed-off-by: Derick Montague Change-Id: I8df6ef7a73ad687dc2c7f5db810a221668a1dd01 --- vue.config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'vue.config.js') diff --git a/vue.config.js b/vue.config.js index 881c6248..4b7c2924 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,3 +1,5 @@ +const CompressionPlugin = require("compression-webpack-plugin"); + module.exports = { devServer: { proxy: { @@ -14,6 +16,23 @@ module.exports = { } } } + }, + port: 8000 + }, + productionSourceMap: false, + configureWebpack: config => { + if (process.env.NODE_ENV === "production") { + config.plugins.push( + new CompressionPlugin({ + deleteOriginalAssets: true + }) + ); + } + }, + chainWebpack: config => { + if (process.env.NODE_ENV === "production") { + config.plugins.delete("prefetch"); + config.plugins.delete("preload"); } } }; -- cgit v1.2.3