Dockerfile: enable pnpm hoisting so react/react-dom are at top-level

The pnpm isolated linker puts packages deep in .pnpm/store. Adding
node-linker=hoisted to .npmrc makes pnpm hoist packages like npm, so
react is accessible at /app/node_modules/react.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kunthawat Greethong
2026-05-03 17:38:07 +07:00
parent f05d518d7f
commit ba717ceeff

View File

@@ -15,6 +15,8 @@ WORKDIR /app/emdash
# Add blog template as workspace package and install all deps
RUN cp -r /app/blog-template packages/blog-template
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
# Enable hoisting so packages are accessible at top-level node_modules
RUN echo "node-linker=hoisted" >> .npmrc
RUN pnpm install
# Build all packages including the blog template