fix(deploy): add .js extensions to transpiled migration imports for ESM compatibility
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 5m30s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Failing after 3m20s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-03-11 00:38:23 +01:00
parent ff269b1f84
commit ea8bd46973

View File

@@ -41,8 +41,10 @@ COPY . .
# Build application
RUN pnpm build
# Transpile migrations for production runner
RUN pnpm exec tsc migrations/*.ts --outDir migrations_built --module esnext --target esnext --moduleResolution node --esModuleInterop --skipLibCheck || true
# Transpile migrations to JS for production compatibility (ESM requires extensions)
RUN npx tsc migrations/*.ts --outDir migrations --module esnext --target esnext --moduleResolution node --esModuleInterop --skipLibCheck || true && \
sed -i 's/from "\.\/\([^"]*\)";/from ".\/\1.js";/g' migrations/index.js && \
rm migrations/*.ts
# Stage 2: Runner
FROM node:20-alpine AS runner