This commit is contained in:
Jesse-Ma
2022-07-21 18:51:30 +08:00
parent 0bdd2eea5c
commit deb1fbe49d
22 changed files with 26943 additions and 346 deletions

View File

@@ -1,16 +1,36 @@
const {defineConfig} = require('@vue/cli-service')
const { defineConfig } = require("@vue/cli-service");
const CompressionPlugin = require("compression-webpack-plugin");
module.exports = defineConfig({
transpileDependencies: true,
devServer: {
proxy: {
'/note': {
target: 'http://localhost:55555/', // 后台接口域
secure: false, // 如果是https接口需要配置这个参数
changeOrigin: true, //是否跨域
pathRewrite:{
// '^/': '/'
}
}
}
}
})
configureWebpack: {
plugins: [
new CompressionPlugin({
algorithm: "gzip", // 使用gzip压缩
test: /\.js$|\.html$|\.png$|\.jpg$|\.svg$|\.css$/, // 匹配文件
filename: "[path][base].gz[query]", // 压缩后的文件名(保持原文件名,后缀加.gz)
minRatio: 1, // 压缩率小于1才会压缩
threshold: 5120, // 对超过10k的数据压缩
deleteOriginalAssets: false, // 是否删除未压缩的源文件谨慎设置如果希望提供非gzip的资源可不设置或者设置为false比如删除打包后的gz后还可以加载到原始资源文件
}),
],
},
transpileDependencies: true,
chainWebpack: (config) => {
config.plugin("html").tap((args) => {
args[0].title = "flagnote.com";
return args;
});
},
devServer: {
proxy: {
"/note": {
target: "http://12coffee.club:3333/", // 后台接口域名
secure: false, // 如果是https接口需要配置这个参数
changeOrigin: true, //是否跨域
pathRewrite: {
// '^/': '/'
},
},
},
},
});