From 86f11d98e8bfac9bf4f64b2d2304e0028e427250 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Fri, 8 May 2026 16:32:09 +0800 Subject: [PATCH] fix(frontend): configure pnpm v11 build approvals in workspace file pnpm v11 no longer supports onlyBuiltDependencies in package.json and does not accept install-time --allow-build flags. Move build-script approvals to pnpm-workspace.yaml and copy it before install in Dockerfile so CI Docker builds can apply allowBuilds during pnpm install. --- frontend/Dockerfile | 3 ++- frontend/package.json | 7 ------- frontend/pnpm-workspace.yaml | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 frontend/pnpm-workspace.yaml diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f990858e..2d93f248 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -9,11 +9,12 @@ ENV VITE_IS_DOCKER=true # 复制依赖文件 COPY package*.json ./ +COPY pnpm-workspace.yaml ./ COPY packages/xlsx-0.20.2.tgz ./packages/xlsx-0.20.2.tgz # 安装依赖 RUN corepack enable -RUN pnpm install --allow-build=@vue-office/pptx --allow-build=esbuild --allow-build=vue-demi +RUN pnpm install # 复制项目文件 COPY . . diff --git a/frontend/package.json b/frontend/package.json index e532a5c6..a7bd9af3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -60,12 +60,5 @@ "lightningcss": "none", "esbuild": "^0.25.0", "serialize-javascript": "^7.0.3" - }, - "pnpm": { - "onlyBuiltDependencies": [ - "@vue-office/pptx", - "esbuild", - "vue-demi" - ] } } diff --git a/frontend/pnpm-workspace.yaml b/frontend/pnpm-workspace.yaml new file mode 100644 index 00000000..fa6cdc76 --- /dev/null +++ b/frontend/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +allowBuilds: + "@vue-office/pptx": true + esbuild: true + vue-demi: true