fix: 修复 npm 依赖安全漏洞并消除 CSS 顺序警告

- 执行 npm audit fix 自动修复 41 个漏洞中的大部分(babel、webpack、axios 等)
- 在 package.json 中添加 overrides 强制升级无法自动修复的间接依赖:
  - postcss >= 8.4.31(修复 CVE in @vue/component-compiler-utils)
  - serialize-javascript >= 7.0.5(修复 XSS/RCE in copy-webpack-plugin)
  - webpack-dev-server >= 5.2.1(修复源码泄露漏洞)
- 漏洞数从 41 降至 0
- vue.config.js 中为 mini-css-extract-plugin 添加 ignoreOrder: true,
  消除 Element Plus 按需导入时不同路由 chunk CSS 顺序冲突的警告

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
灌糖包子 2026-04-11 01:10:58 +08:00
parent c144830fd7
commit d5d82d3488
Signed by: sookie
GPG Key ID: 343F7F37BECCFAE2
4 changed files with 4976 additions and 3627 deletions

4865
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,11 @@
"unplugin-auto-import": "^0.12.1",
"unplugin-vue-components": "^0.22.12"
},
"overrides": {
"postcss": ">=8.4.31",
"serialize-javascript": ">=7.0.5",
"webpack-dev-server": ">=5.2.1"
},
"browserslist": [
"> 1%",
"last 2 versions",

View File

@ -32,6 +32,13 @@ module.exports = defineConfig({
// fork-ts-checker-webpack-plugin v6 与 TypeScript 5 不兼容(无法覆写只读的 performance.mark
// 类型检查改由 tsc --noEmit 承担
config.plugins.delete('fork-ts-checker')
// Element Plus 按需导入时,不同路由 chunk 的 CSS 导入顺序不一致,
// 但这不影响最终样式specificity 规则优先),忽略该警告
config.plugin('extract-css').tap(args => {
args[0].ignoreOrder = true
return args
})
},
devServer: {
port: 8080,

3726
yarn.lock

File diff suppressed because it is too large Load Diff