mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
fix(gateway): use esbuild to bundle workspace packages in Docker
Replace tsc with esbuild for building @multica/sdk and @multica/store in the Docker builder stage. esbuild resolves extensionless imports that Node.js ESM cannot handle at runtime, producing self-contained bundles for each workspace package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,10 +14,13 @@ COPY packages/store/package.json ./packages/store/
|
||||
# Install all dependencies (including devDependencies for build)
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy workspace packages and build them
|
||||
# Copy workspace packages and bundle them with esbuild (resolves extensionless imports)
|
||||
COPY packages/sdk/ ./packages/sdk/
|
||||
COPY packages/store/ ./packages/store/
|
||||
RUN pnpm --filter @multica/sdk build && cd packages/store && ../../node_modules/.bin/tsc
|
||||
RUN ./node_modules/.bin/esbuild packages/sdk/src/index.ts \
|
||||
--bundle --platform=node --format=esm --outfile=packages/sdk/dist/index.js --packages=external && \
|
||||
./node_modules/.bin/esbuild packages/store/src/index.ts packages/store/src/connection.ts \
|
||||
--bundle --splitting --platform=node --format=esm --outdir=packages/store/dist --packages=external
|
||||
|
||||
# Copy source code
|
||||
COPY tsconfig.json ./
|
||||
|
||||
Reference in New Issue
Block a user