Commit 496bac9e by jiang'yun

修改

parent 484a8107
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,6 +4,7 @@
"description": "系统",
"author": "若依",
"license": "MIT",
"sideEffects": false,
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
......
......@@ -36,7 +36,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.31.108:8091`,
target: `http://127.0.0.1:8091`,
// target: `http://192.168.31.190:8091`,
// target: `http://192.168.31.12:8091`,
// target: `http://192.168.110.69:8091`,
......@@ -51,6 +51,7 @@ module.exports = {
disableHostCheck: true,
},
css: {
sourceMap: process.env.NODE_ENV === "production",
loaderOptions: {
sass: {
sassOptions: { outputStyle: "expanded" },
......@@ -67,8 +68,21 @@ module.exports = {
module: {
rules: [
{
test: /\.sgy$/,
use: "file-loader",
test: /\.(png|jpe?g|gif|webp)(\?.*)?$/,
use: [
{
loader: 'url-loader',
options: {
limit: 10240, // 10KB以下转base64
fallback: {
loader: 'file-loader',
options: {
name: 'static/img/[name].[hash:8].[ext]'
}
}
}
}
],
type: "javascript/auto",
},
],
......@@ -76,11 +90,12 @@ module.exports = {
plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
cache: true, // 启用文件缓存
test: /\.(js|css|html|svg)?$/i, // 压缩文件格式
filename: "[path][base].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
minRatio: 0.9, // 压缩比例,小于 80% 的文件不会被压缩
threshold: 8192, // 仅压缩大于8KB的文件(小文件压缩无意义)
deleteOriginalAssets: false, // 压缩后删除原文件
}),
new BundleAnalyzerPlugin({
......@@ -133,11 +148,16 @@ module.exports = {
name: "chunk-elementUI", // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
chunks: "all", // 不仅拆分initial,也拆分异步chunk中的Element UI
},
commons: {
name: "chunk-commons",
name: (module, chunks, cacheGroupKey) => {
const moduleFileName = module.identifier().split('/').reduceRight(item => item);
const allChunksNames = chunks.map(item => item.name).join('~');
return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`;
},
test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number
minChunks: 2, // minimum common number
priority: 5,
reuseExistingChunk: true,
},
......
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