Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中汽测评-信息安全测评系统
web
Commits
39f943f2
Commit
39f943f2
authored
Feb 21, 2024
by
mzx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
32c0c428
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18258 additions
and
18258 deletions
+18258
-18258
.gitignore
.gitignore
+24
-24
package copy.json
package copy.json
+90
-90
package-lock copy.json
package-lock copy.json
+18008
-18008
monitor.svg
src/assets/icons/svg/monitor.svg
+1
-1
system.svg
src/assets/icons/svg/system.svg
+1
-1
vue.config copy.js
vue.config copy.js
+134
-134
No files found.
.gitignore
View file @
39f943f2
.DS_Store
.DS_Store
node_modules/
node_modules/
dist/
dist/
构建产物/
构建产物/
npm-debug.log*
npm-debug.log*
yarn-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
**/*.log
**/*.log
tests/**/coverage/
tests/**/coverage/
tests/e2e/reports
tests/e2e/reports
selenium-debug.log
selenium-debug.log
# Editor directories and files
# Editor directories and files
.idea
.idea
.vscode
.vscode
*.suo
*.suo
*.ntvs*
*.ntvs*
*.njsproj
*.njsproj
*.sln
*.sln
*.local
*.local
*.history
*.history
package-lock.json
package-lock.json
yarn.lock
yarn.lock
package copy.json
View file @
39f943f2
{
{
"name"
:
"ruoyi"
,
"name"
:
"ruoyi"
,
"version"
:
"3.8.6"
,
"version"
:
"3.8.6"
,
"description"
:
"中汽研安全检测平台管理系统"
,
"description"
:
"中汽研安全检测平台管理系统"
,
"author"
:
"中汽研安全检测平台"
,
"author"
:
"中汽研安全检测平台"
,
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"scripts"
:
{
"scripts"
:
{
"dev"
:
"vue-cli-service serve"
,
"dev"
:
"vue-cli-service serve"
,
"build:prod"
:
"vue-cli-service build"
,
"build:prod"
:
"vue-cli-service build"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
"preview"
:
"node build/index.js --preview"
,
"preview"
:
"node build/index.js --preview"
,
"lint"
:
"eslint --ext .js,.vue src"
"lint"
:
"eslint --ext .js,.vue src"
},
},
"husky"
:
{
"husky"
:
{
"hooks"
:
{
"hooks"
:
{
"pre-commit"
:
"lint-staged"
"pre-commit"
:
"lint-staged"
}
}
},
},
"lint-staged"
:
{
"lint-staged"
:
{
"src/**/*.{js,vue}"
:
[
"src/**/*.{js,vue}"
:
[
"eslint --fix"
,
"eslint --fix"
,
"git add"
"git add"
]
]
},
},
"keywords"
:
[
"keywords"
:
[
"vue"
,
"vue"
,
"admin"
,
"admin"
,
"dashboard"
,
"dashboard"
,
"element-ui"
,
"element-ui"
,
"boilerplate"
,
"boilerplate"
,
"admin-template"
,
"admin-template"
,
"management-system"
"management-system"
],
],
"repository"
:
{
"repository"
:
{
"type"
:
"git"
,
"type"
:
"git"
,
"url"
:
"https://gitee.com/y_project/RuoYi-Vue.git"
"url"
:
"https://gitee.com/y_project/RuoYi-Vue.git"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@riophae/vue-treeselect"
:
"0.4.0"
,
"@riophae/vue-treeselect"
:
"0.4.0"
,
"axios"
:
"0.24.0"
,
"axios"
:
"0.24.0"
,
"clipboard"
:
"2.0.8"
,
"clipboard"
:
"2.0.8"
,
"core-js"
:
"3.25.3"
,
"core-js"
:
"3.25.3"
,
"echarts"
:
"5.4.0"
,
"echarts"
:
"5.4.0"
,
"element-ui"
:
"2.15.13"
,
"element-ui"
:
"2.15.13"
,
"file-saver"
:
"2.0.5"
,
"file-saver"
:
"2.0.5"
,
"fuse.js"
:
"6.4.3"
,
"fuse.js"
:
"6.4.3"
,
"highlight.js"
:
"9.18.5"
,
"highlight.js"
:
"9.18.5"
,
"js-beautify"
:
"1.13.0"
,
"js-beautify"
:
"1.13.0"
,
"js-cookie"
:
"3.0.1"
,
"js-cookie"
:
"3.0.1"
,
"jsencrypt"
:
"3.0.0-rc.1"
,
"jsencrypt"
:
"3.0.0-rc.1"
,
"nprogress"
:
"0.2.0"
,
"nprogress"
:
"0.2.0"
,
"quill"
:
"1.3.7"
,
"quill"
:
"1.3.7"
,
"screenfull"
:
"5.0.2"
,
"screenfull"
:
"5.0.2"
,
"sortablejs"
:
"1.10.2"
,
"sortablejs"
:
"1.10.2"
,
"vue"
:
"2.6.12"
,
"vue"
:
"2.6.12"
,
"vue-count-to"
:
"1.0.13"
,
"vue-count-to"
:
"1.0.13"
,
"vue-cropper"
:
"0.5.5"
,
"vue-cropper"
:
"0.5.5"
,
"vue-meta"
:
"2.4.0"
,
"vue-meta"
:
"2.4.0"
,
"vue-router"
:
"3.4.9"
,
"vue-router"
:
"3.4.9"
,
"vuedraggable"
:
"2.24.3"
,
"vuedraggable"
:
"2.24.3"
,
"vuex"
:
"3.6.0"
"vuex"
:
"3.6.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@vue/cli-plugin-babel"
:
"4.4.6"
,
"@vue/cli-plugin-babel"
:
"4.4.6"
,
"@vue/cli-plugin-eslint"
:
"4.4.6"
,
"@vue/cli-plugin-eslint"
:
"4.4.6"
,
"@vue/cli-service"
:
"4.4.6"
,
"@vue/cli-service"
:
"4.4.6"
,
"babel-eslint"
:
"10.1.0"
,
"babel-eslint"
:
"10.1.0"
,
"babel-plugin-dynamic-import-node"
:
"2.3.3"
,
"babel-plugin-dynamic-import-node"
:
"2.3.3"
,
"chalk"
:
"4.1.0"
,
"chalk"
:
"4.1.0"
,
"compression-webpack-plugin"
:
"5.0.2"
,
"compression-webpack-plugin"
:
"5.0.2"
,
"connect"
:
"3.6.6"
,
"connect"
:
"3.6.6"
,
"eslint"
:
"7.15.0"
,
"eslint"
:
"7.15.0"
,
"eslint-plugin-vue"
:
"7.2.0"
,
"eslint-plugin-vue"
:
"7.2.0"
,
"lint-staged"
:
"10.5.3"
,
"lint-staged"
:
"10.5.3"
,
"runjs"
:
"4.4.2"
,
"runjs"
:
"4.4.2"
,
"sass"
:
"1.32.13"
,
"sass"
:
"1.32.13"
,
"sass-loader"
:
"10.1.1"
,
"sass-loader"
:
"10.1.1"
,
"script-ext-html-webpack-plugin"
:
"2.1.5"
,
"script-ext-html-webpack-plugin"
:
"2.1.5"
,
"svg-sprite-loader"
:
"5.1.1"
,
"svg-sprite-loader"
:
"5.1.1"
,
"vue-template-compiler"
:
"2.6.12"
"vue-template-compiler"
:
"2.6.12"
},
},
"engines"
:
{
"engines"
:
{
"node"
:
">=8.9"
,
"node"
:
">=8.9"
,
"npm"
:
">= 3.0.0"
"npm"
:
">= 3.0.0"
},
},
"browserslist"
:
[
"browserslist"
:
[
"> 1%"
,
"> 1%"
,
"last 2 versions"
"last 2 versions"
]
]
}
}
package-lock copy.json
View file @
39f943f2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/assets/icons/svg/monitor.svg
View file @
39f943f2
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1543827393750"
class=
"icon"
style=
""
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4695"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
>
@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1543827393750"
class=
"icon"
style=
""
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4695"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
>
@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
</style></defs><path
d=
"M64 64V640H896V64H64zM0 0h960v704H0V0z"
p-id=
"4696"
></path><path
d=
"M192 896H768v64H192zM448 640H512v256h-64z"
p-id=
"4697"
></path><path
d=
"M479.232 561.604267l309.9904-348.330667-47.803733-42.5472-259.566934 291.669333L303.957333 240.008533 163.208533 438.6048l52.224 37.009067 91.6224-129.28z"
p-id=
"4698"
></path></svg>
</style></defs><path
d=
"M64 64V640H896V64H64zM0 0h960v704H0V0z"
p-id=
"4696"
></path><path
d=
"M192 896H768v64H192zM448 640H512v256h-64z"
p-id=
"4697"
></path><path
d=
"M479.232 561.604267l309.9904-348.330667-47.803733-42.5472-259.566934 291.669333L303.957333 240.008533 163.208533 438.6048l52.224 37.009067 91.6224-129.28z"
p-id=
"4698"
></path></svg>
\ No newline at end of file
src/assets/icons/svg/system.svg
View file @
39f943f2
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1543827724451"
class=
"icon"
style=
""
viewBox=
"0 0 1084 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"10233"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"211.71875"
height=
"200"
><defs><style
type=
"text/css"
>
@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1543827724451"
class=
"icon"
style=
""
viewBox=
"0 0 1084 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"10233"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"211.71875"
height=
"200"
><defs><style
type=
"text/css"
>
@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
</style></defs><path
d=
"M1080.09609 434.500756c-4.216302-23.731757-26.9241-47.945376-50.595623-53.185637l-17.648235-4.095836a175.940257 175.940257 0 0 1-101.612877-80.832531 177.807476 177.807476 0 0 1-18.732427-129.801867l5.541425-16.684509c7.10748-23.129428-2.108151-54.992624-20.599646-70.833873 0 0-16.624276-14.094495-63.244529-41.199293-46.800951-26.984332-66.858502-34.513443-66.858502-34.513443-22.76803-8.372371-54.631227-0.361397-71.255503 17.407304l-12.287509 13.251234a173.470708 173.470708 0 0 1-120.465769 48.065842A174.13327 174.13327 0 0 1 421.329029 33.590675L409.583617 20.761071C393.140039 2.99237 361.096144-4.898138 338.267881 3.353767c0 0-20.358715 7.529111-67.099434 34.513443-46.800951 27.34573-63.244529 41.440225-63.244529 41.440225-18.431263 15.66055-27.646894 47.222582-20.539413 70.592941l5.059562 16.865207a178.048407 178.048407 0 0 1-18.672194 129.621169 174.916297 174.916297 0 0 1-102.275439 81.073463l-17.045906 3.854904c-23.310126 5.42096-46.258856 29.333415-50.595623 53.185637 0 0-3.854905 21.382674-3.854905 75.712737 0 54.330062 3.854905 75.712736 3.854905 75.712736 4.216302 23.972688 26.9241 47.945376 50.595623 53.185637l16.624276 3.854905a174.253736 174.253736 0 0 1 102.395904 81.314394c23.310126 40.837896 28.911785 87.337683 18.732427 129.801867l-4.81863 16.443578c-7.10748 23.129428 2.108151 54.992624 20.599646 70.833872 0 0 16.624276 14.094495 63.244529 41.199293 46.800951 27.104798 66.918735 34.513443 66.918735 34.513443 22.707798 8.372371 54.631227 0.361397 71.255503-17.407303l11.624947-12.588673a175.096996 175.096996 0 0 1 242.256662 0.120465l11.624947 12.648906c16.383345 17.708468 48.427239 25.598976 71.255503 17.347071 0 0 20.358715-7.529111 67.159666-34.513443 46.740719-27.104798 63.124063-41.199293 63.124064-41.199293 18.491496-15.600317 27.707127-47.463513 20.599646-70.833873l-5.059562-17.106139a176.723284 176.723284 0 0 1 18.672194-129.139305 176.060722 176.060722 0 0 1 102.395904-81.314394l16.68451-3.854905c23.310126-5.42096 46.258856-29.333415 50.595623-53.185637 0 0 3.854905-21.382674 3.854904-75.712737-0.240932-54.330062-4.095836-75.833202-4.095836-75.833202z m-537.819428 293.334149c-119.261112 0-216.175824-97.336342-216.175824-217.621412a216.657687 216.657687 0 0 1 216.236057-217.320249c119.200879 0 216.115591 97.276109 216.11559 217.56118-0.240932 120.044139-96.974945 217.320248-216.175823 217.320249z"
p-id=
"10234"
></path></svg>
</style></defs><path
d=
"M1080.09609 434.500756c-4.216302-23.731757-26.9241-47.945376-50.595623-53.185637l-17.648235-4.095836a175.940257 175.940257 0 0 1-101.612877-80.832531 177.807476 177.807476 0 0 1-18.732427-129.801867l5.541425-16.684509c7.10748-23.129428-2.108151-54.992624-20.599646-70.833873 0 0-16.624276-14.094495-63.244529-41.199293-46.800951-26.984332-66.858502-34.513443-66.858502-34.513443-22.76803-8.372371-54.631227-0.361397-71.255503 17.407304l-12.287509 13.251234a173.470708 173.470708 0 0 1-120.465769 48.065842A174.13327 174.13327 0 0 1 421.329029 33.590675L409.583617 20.761071C393.140039 2.99237 361.096144-4.898138 338.267881 3.353767c0 0-20.358715 7.529111-67.099434 34.513443-46.800951 27.34573-63.244529 41.440225-63.244529 41.440225-18.431263 15.66055-27.646894 47.222582-20.539413 70.592941l5.059562 16.865207a178.048407 178.048407 0 0 1-18.672194 129.621169 174.916297 174.916297 0 0 1-102.275439 81.073463l-17.045906 3.854904c-23.310126 5.42096-46.258856 29.333415-50.595623 53.185637 0 0-3.854905 21.382674-3.854905 75.712737 0 54.330062 3.854905 75.712736 3.854905 75.712736 4.216302 23.972688 26.9241 47.945376 50.595623 53.185637l16.624276 3.854905a174.253736 174.253736 0 0 1 102.395904 81.314394c23.310126 40.837896 28.911785 87.337683 18.732427 129.801867l-4.81863 16.443578c-7.10748 23.129428 2.108151 54.992624 20.599646 70.833872 0 0 16.624276 14.094495 63.244529 41.199293 46.800951 27.104798 66.918735 34.513443 66.918735 34.513443 22.707798 8.372371 54.631227 0.361397 71.255503-17.407303l11.624947-12.588673a175.096996 175.096996 0 0 1 242.256662 0.120465l11.624947 12.648906c16.383345 17.708468 48.427239 25.598976 71.255503 17.347071 0 0 20.358715-7.529111 67.159666-34.513443 46.740719-27.104798 63.124063-41.199293 63.124064-41.199293 18.491496-15.600317 27.707127-47.463513 20.599646-70.833873l-5.059562-17.106139a176.723284 176.723284 0 0 1 18.672194-129.139305 176.060722 176.060722 0 0 1 102.395904-81.314394l16.68451-3.854905c23.310126-5.42096 46.258856-29.333415 50.595623-53.185637 0 0 3.854905-21.382674 3.854904-75.712737-0.240932-54.330062-4.095836-75.833202-4.095836-75.833202z m-537.819428 293.334149c-119.261112 0-216.175824-97.336342-216.175824-217.621412a216.657687 216.657687 0 0 1 216.236057-217.320249c119.200879 0 216.115591 97.276109 216.11559 217.56118-0.240932 120.044139-96.974945 217.320248-216.175823 217.320249z"
p-id=
"10234"
></path></svg>
\ No newline at end of file
vue.config copy.js
View file @
39f943f2
'use strict'
'use strict'
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
function
resolve
(
dir
)
{
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
dir
)
return
path
.
join
(
__dirname
,
dir
)
}
}
const
CompressionPlugin
=
require
(
'compression-webpack-plugin'
)
const
CompressionPlugin
=
require
(
'compression-webpack-plugin'
)
const
name
=
process
.
env
.
VUE_APP_TITLE
||
'中汽研安全检测平台管理系统'
// 网页标题
const
name
=
process
.
env
.
VUE_APP_TITLE
||
'中汽研安全检测平台管理系统'
// 网页标题
const
port
=
process
.
env
.
port
||
process
.
env
.
npm_config_port
||
80
// 端口
const
port
=
process
.
env
.
port
||
process
.
env
.
npm_config_port
||
80
// 端口
// vue.config.js 配置说明
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档
// 这里只列一部分,具体配置参考文档
module
.
exports
=
{
module
.
exports
=
{
// 部署生产环境和开发环境下的URL。
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath
:
process
.
env
.
NODE_ENV
===
"production"
?
"/"
:
"/"
,
publicPath
:
process
.
env
.
NODE_ENV
===
"production"
?
"/"
:
"/"
,
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir
:
'dist'
,
outputDir
:
'dist'
,
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir
:
'static'
,
assetsDir
:
'static'
,
// 是否开启eslint保存检测,有效值:ture | false | 'error'
// 是否开启eslint保存检测,有效值:ture | false | 'error'
lintOnSave
:
process
.
env
.
NODE_ENV
===
'development'
,
lintOnSave
:
process
.
env
.
NODE_ENV
===
'development'
,
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap
:
false
,
productionSourceMap
:
false
,
// webpack-dev-server 相关配置
// webpack-dev-server 相关配置
devServer
:
{
devServer
:
{
host
:
'0.0.0.0'
,
host
:
'0.0.0.0'
,
port
:
port
,
port
:
port
,
open
:
true
,
open
:
true
,
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://localhost:8080`
,
target
:
`http://localhost:8080`
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
}
}
}
}
},
},
disableHostCheck
:
true
disableHostCheck
:
true
},
},
css
:
{
css
:
{
loaderOptions
:
{
loaderOptions
:
{
sass
:
{
sass
:
{
sassOptions
:
{
outputStyle
:
"expanded"
}
sassOptions
:
{
outputStyle
:
"expanded"
}
}
}
}
}
},
},
configureWebpack
:
{
configureWebpack
:
{
name
:
name
,
name
:
name
,
resolve
:
{
resolve
:
{
alias
:
{
alias
:
{
'@'
:
resolve
(
'src'
)
'@'
:
resolve
(
'src'
)
}
}
},
},
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
:
false
,
// 不启用文件缓存
test
:
/
\.(
js|css|html
)?
$/i
,
// 压缩文件格式
test
:
/
\.(
js|css|html
)?
$/i
,
// 压缩文件格式
filename
:
'[path].gz[query]'
,
// 压缩后的文件名
filename
:
'[path].gz[query]'
,
// 压缩后的文件名
algorithm
:
'gzip'
,
// 使用gzip压缩
algorithm
:
'gzip'
,
// 使用gzip压缩
minRatio
:
0.8
// 压缩率小于1才会压缩
minRatio
:
0.8
// 压缩率小于1才会压缩
})
})
],
],
},
},
chainWebpack
(
config
)
{
chainWebpack
(
config
)
{
config
.
plugins
.
delete
(
'preload'
)
// TODO: need test
config
.
plugins
.
delete
(
'preload'
)
// TODO: need test
config
.
plugins
.
delete
(
'prefetch'
)
// TODO: need test
config
.
plugins
.
delete
(
'prefetch'
)
// TODO: need test
// set svg-sprite-loader
// set svg-sprite-loader
config
.
module
config
.
module
.
rule
(
'svg'
)
.
rule
(
'svg'
)
.
exclude
.
add
(
resolve
(
'src/assets/icons'
))
.
exclude
.
add
(
resolve
(
'src/assets/icons'
))
.
end
()
.
end
()
config
.
module
config
.
module
.
rule
(
'icons'
)
.
rule
(
'icons'
)
.
test
(
/
\.
svg$/
)
.
test
(
/
\.
svg$/
)
.
include
.
add
(
resolve
(
'src/assets/icons'
))
.
include
.
add
(
resolve
(
'src/assets/icons'
))
.
end
()
.
end
()
.
use
(
'svg-sprite-loader'
)
.
use
(
'svg-sprite-loader'
)
.
loader
(
'svg-sprite-loader'
)
.
loader
(
'svg-sprite-loader'
)
.
options
({
.
options
({
symbolId
:
'icon-[name]'
symbolId
:
'icon-[name]'
})
})
.
end
()
.
end
()
config
.
when
(
process
.
env
.
NODE_ENV
!==
'development'
,
config
=>
{
config
.
when
(
process
.
env
.
NODE_ENV
!==
'development'
,
config
=>
{
config
config
.
plugin
(
'ScriptExtHtmlWebpackPlugin'
)
.
plugin
(
'ScriptExtHtmlWebpackPlugin'
)
.
after
(
'html'
)
.
after
(
'html'
)
.
use
(
'script-ext-html-webpack-plugin'
,
[{
.
use
(
'script-ext-html-webpack-plugin'
,
[{
// `runtime` must same as runtimeChunk name. default is `runtime`
// `runtime` must same as runtimeChunk name. default is `runtime`
inline
:
/runtime
\.
.*
\.
js$/
inline
:
/runtime
\.
.*
\.
js$/
}])
}])
.
end
()
.
end
()
config
.
optimization
.
splitChunks
({
config
.
optimization
.
splitChunks
({
chunks
:
'all'
,
chunks
:
'all'
,
cacheGroups
:
{
cacheGroups
:
{
libs
:
{
libs
:
{
name
:
'chunk-libs'
,
name
:
'chunk-libs'
,
test
:
/
[\\/]
node_modules
[\\/]
/
,
test
:
/
[\\/]
node_modules
[\\/]
/
,
priority
:
10
,
priority
:
10
,
chunks
:
'initial'
// only package third parties that are initially dependent
chunks
:
'initial'
// only package third parties that are initially dependent
},
},
elementUI
:
{
elementUI
:
{
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
},
},
commons
:
{
commons
:
{
name
:
'chunk-commons'
,
name
:
'chunk-commons'
,
test
:
resolve
(
'src/components'
),
// can customize your rules
test
:
resolve
(
'src/components'
),
// can customize your rules
minChunks
:
3
,
// minimum common number
minChunks
:
3
,
// minimum common number
priority
:
5
,
priority
:
5
,
reuseExistingChunk
:
true
reuseExistingChunk
:
true
}
}
}
}
})
})
config
.
optimization
.
runtimeChunk
(
'single'
),
config
.
optimization
.
runtimeChunk
(
'single'
),
{
{
from
:
path
.
resolve
(
__dirname
,
'./public/robots.txt'
),
//防爬虫文件
from
:
path
.
resolve
(
__dirname
,
'./public/robots.txt'
),
//防爬虫文件
to
:
'./'
//到根目录下
to
:
'./'
//到根目录下
}
}
})
})
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment