install frontend devDependencies explicitly in the build stage
vite and the build toolchain live under devDependencies; proxied/base-image npm defaults to omit=dev, leaving 'vite: not found' at build time. Force --include=dev so the build stage always has its toolchain.
This commit is contained in:
@@ -45,10 +45,14 @@ COPY frontend/package*.json ./frontend/
|
||||
# guard keeps NODE_EXTRA_CA_CERTS unset on a clean checkout (no cert), so Node
|
||||
# does not warn about a missing cert path; a proxy-inspected build still gets
|
||||
# the cert because the file is present.
|
||||
# Force devDependencies in: vite and the rest of the build toolchain live under
|
||||
# devDependencies, and some base images / proxied environments default npm to
|
||||
# omit=dev, which leaves `vite: not found` at build time. A build stage always
|
||||
# needs them, so include them explicitly regardless of the ambient NODE_ENV.
|
||||
RUN if [ -f /usr/local/share/ca-certificates/corp-root-ca.crt ]; then \
|
||||
export NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/corp-root-ca.crt; \
|
||||
fi; \
|
||||
cd frontend && npm ci
|
||||
cd frontend && npm ci --include=dev
|
||||
|
||||
# The frontend keeps its repo-relative layout here, because npm prebuild runs
|
||||
# `node ../scripts/stage-frontend.mjs`, which stages each plugin's frontend/ into
|
||||
|
||||
Reference in New Issue
Block a user