Skip to content

Commit 40019c4

Browse files
fix: rollup issue - npm/cli#4828
1 parent 880f5d9 commit 40019c4

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

.npmrc

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
node-linker=hoisted # Helps with dependency deduplication across all Node.js apps
2-
public-hoist-pattern[]=*rollup* # Benefits both Nuxt and NestJS builds
3-
public-hoist-pattern[]=*esbuild* # Used by both Nuxt and NestJS
4-
public-hoist-pattern[]=*webpack* # NestJS uses webpack by default
5-
legacy-peer-deps=true # Helps resolve peer dependency issues across all Node.js apps
6-
shamefully-hoist=true # Ensures build dependencies are available across workspace
7-
prefer-dedupe=true # Reduces node_modules size for all apps
1+
node-linker=hoisted
2+
shamefully-hoist=true
3+
strict-peer-dependencies=false
4+
legacy-peer-deps=true
5+
resolution-mode=highest
6+
build-from-source=true
7+
platform=linux
8+
arch=x64
9+
public-hoist-pattern[]=*rollup*
10+
public-hoist-pattern[]=*esbuild*
11+
public-hoist-pattern[]=*webpack*
12+
public-hoist-pattern[]=*types*
13+
public-hoist-pattern[]=*vue*
14+
public-hoist-pattern[]=*nuxt*
15+
public-hoist-pattern[]=*vite*
16+
public-hoist-pattern[]=@rollup/*

apps/app/Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ ARG NUXT_PUBLIC_SUPABASE_URL
88
ENV NX_CLOUD_ACCESS_TOKEN=${NX_CLOUD_ACCESS_TOKEN} \
99
NODE_ENV=production \
1010
NUXT_PUBLIC_SUPABASE_URL=${NUXT_PUBLIC_SUPABASE_URL} \
11+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
1112
ROLLUP_SKIP_NODE_RESOLVE=true \
12-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
13+
ROLLUP_NATIVE=false \
14+
npm_config_build_from_source=true
1315

1416
# Install required build dependencies
1517
RUN apt-get update && \
@@ -22,15 +24,23 @@ COPY nx.json ./
2224
COPY tsconfig*.json ./
2325
COPY .npmrc ./
2426

27+
# Pre-install specific platform dependencies
28+
RUN npm install -g @rollup/rollup-linux-x64-gnu @rollup/rollup-linux-x64-musl --no-save
29+
30+
# Install root dependencies with platform specifics
31+
RUN npm install --no-progress --platform=linux --arch=x64
32+
2533
# Copy only needed source files
2634
COPY apps/app ./apps/app
2735
COPY libs ./libs
2836
COPY layers ./layers
2937

30-
# Install dependencies with platform specifics
31-
RUN npm install --no-progress
38+
# Install workspace dependencies
3239
RUN npm install --workspaces
3340

41+
# Now copy source files
42+
COPY . .
43+
3444
# Install nx and build
3545
RUN npm install nx@latest -g
3646
RUN nx reset

0 commit comments

Comments
 (0)