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 @@ ...@@ -4,6 +4,7 @@
"description": "系统", "description": "系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"sideEffects": false,
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
......
...@@ -36,7 +36,7 @@ module.exports = { ...@@ -36,7 +36,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [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.190:8091`,
// target: `http://192.168.31.12:8091`, // target: `http://192.168.31.12:8091`,
// target: `http://192.168.110.69:8091`, // target: `http://192.168.110.69:8091`,
...@@ -51,6 +51,7 @@ module.exports = { ...@@ -51,6 +51,7 @@ module.exports = {
disableHostCheck: true, disableHostCheck: true,
}, },
css: { css: {
sourceMap: process.env.NODE_ENV === "production",
loaderOptions: { loaderOptions: {
sass: { sass: {
sassOptions: { outputStyle: "expanded" }, sassOptions: { outputStyle: "expanded" },
...@@ -67,8 +68,21 @@ module.exports = { ...@@ -67,8 +68,21 @@ module.exports = {
module: { module: {
rules: [ rules: [
{ {
test: /\.sgy$/, test: /\.(png|jpe?g|gif|webp)(\?.*)?$/,
use: "file-loader", use: [
{
loader: 'url-loader',
options: {
limit: 10240, // 10KB以下转base64
fallback: {
loader: 'file-loader',
options: {
name: 'static/img/[name].[hash:8].[ext]'
}
}
}
}
],
type: "javascript/auto", type: "javascript/auto",
}, },
], ],
...@@ -76,11 +90,12 @@ module.exports = { ...@@ -76,11 +90,12 @@ module.exports = {
plugins: [ plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({ new CompressionPlugin({
cache: false, // 不启用文件缓存 cache: true, // 启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式 test: /\.(js|css|html|svg)?$/i, // 压缩文件格式
filename: "[path][base].gz[query]", // 压缩后的文件名 filename: "[path][base].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩 algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩 minRatio: 0.9, // 压缩比例,小于 80% 的文件不会被压缩
threshold: 8192, // 仅压缩大于8KB的文件(小文件压缩无意义)
deleteOriginalAssets: false, // 压缩后删除原文件 deleteOriginalAssets: false, // 压缩后删除原文件
}), }),
new BundleAnalyzerPlugin({ new BundleAnalyzerPlugin({
...@@ -133,11 +148,16 @@ module.exports = { ...@@ -133,11 +148,16 @@ module.exports = {
name: "chunk-elementUI", // split elementUI into a single package name: "chunk-elementUI", // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm 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 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: { 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 test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number minChunks: 2, // minimum common number
priority: 5, priority: 5,
reuseExistingChunk: true, 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