Archived
forked from admin/userbase
fix(build): drop node-sass (no Node20 prebuilt); CI strips it from lockfile before npm ci
This commit is contained in:
@@ -28,9 +28,16 @@ jobs:
|
|||||||
working-directory: front
|
working-directory: front
|
||||||
run: npm config set registry https://registry.npmmirror.com
|
run: npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
|
# node-sass(6.x) 无 Node20 预编译二进制,源码编译必失败;项目实际用 dart-sass(sass)。
|
||||||
|
# 本地 lockfile 暂不便修改,这里在 runner 内把它从 lockfile 剔除后再 npm ci(不改仓库文件)。
|
||||||
|
- name: Strip node-sass from lockfile (CI-only)
|
||||||
|
run: |
|
||||||
|
node -e "const fs=require('fs');const p='front/package-lock.json';const d=JSON.parse(fs.readFileSync(p,'utf8'));const pk=d.packages||{};for(const k of Object.keys(pk)){if(k==='node_modules/node-sass'||k.startsWith('node_modules/node-sass/'))delete pk[k];}if(d.dependencies&&d.dependencies.node-sass)delete d.dependencies.node-sass;fs.writeFileSync(p,JSON.stringify(d,null,2));"
|
||||||
|
echo "node-sass stripped from lockfile"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: front
|
working-directory: front
|
||||||
run: npm ci
|
run: npm ci --no-audit --no-fund
|
||||||
|
|
||||||
- name: Build (prod -> dist/prod)
|
- name: Build (prod -> dist/prod)
|
||||||
working-directory: front
|
working-directory: front
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
"@unocss/preset-uno": "^66.6.0",
|
"@unocss/preset-uno": "^66.6.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"node-sass": "^6.0.1",
|
|
||||||
"sass-loader": "^10.0.1",
|
"sass-loader": "^10.0.1",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"unocss": "^66.6.0",
|
"unocss": "^66.6.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user