修复:.dockerignore 放行 dist;Dockerfile 强制显式安装 devDependencies
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ COPY package.json package-lock.json* ./
|
|||||||
# RUN npm config set registry https://registry.npmmirror.com
|
# RUN npm config set registry https://registry.npmmirror.com
|
||||||
RUN npm ci --include=dev
|
RUN npm ci --include=dev
|
||||||
|
|
||||||
|
# 兜底:某些环境的 npm 配置会强制跳过 devDependencies(导致 tsc 缺失、127 报错)
|
||||||
|
# 显式按 package.json 声明逐个安装,explicit install 不受 omit 配置影响
|
||||||
|
RUN npm install --no-save --force $(node -e "console.log(Object.keys(require('./package.json').devDependencies||{}).join(' '))")
|
||||||
|
|
||||||
# 依赖自检:如果 tsc/vite 没装上,在这里就明确失败而不是 127
|
# 依赖自检:如果 tsc/vite 没装上,在这里就明确失败而不是 127
|
||||||
RUN ./node_modules/.bin/tsc --version && ./node_modules/.bin/vite --version
|
RUN ./node_modules/.bin/tsc --version && ./node_modules/.bin/vite --version
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user