fix: mobile CI 使用 hoisted node_modules,修复 webpack DefinePlugin 找不到

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-24 18:20:30 +08:00
1 parent 291de33d54
commit 4e1ca614d4
1 file changed
+2
+2
View File
@@ -52,6 +52,8 @@ steps:
# pnpm-lock.yaml 被 gitignore,不能 --frozen-lockfile
# 跳过 puppeteer 下载 Chromium(H5 构建不需要,否则会卡很久)
- export PUPPETEER_SKIP_DOWNLOAD=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
# 无 lockfile 时 pnpm 默认隔离布局会导致 uni 找不到 webpack/lib/DefinePlugin;改用 hoisted
- printf '%s\n' 'shamefully-hoist=true' 'node-linker=hoisted' >> .npmrc
- pnpm install --no-frozen-lockfile --registry https://registry.npmmirror.com
- pnpm run build
- test -d dist/build/h5