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
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user