Skip to content

Commit

Permalink
fix: rollup issue - npm/cli#4828
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew-Macgibbon committed Dec 28, 2024
1 parent 230ec95 commit 1b28215
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
23 changes: 16 additions & 7 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
node-linker=hoisted # Helps with dependency deduplication across all Node.js apps
public-hoist-pattern[]=*rollup* # Benefits both Nuxt and NestJS builds
public-hoist-pattern[]=*esbuild* # Used by both Nuxt and NestJS
public-hoist-pattern[]=*webpack* # NestJS uses webpack by default
legacy-peer-deps=true # Helps resolve peer dependency issues across all Node.js apps
shamefully-hoist=true # Ensures build dependencies are available across workspace
prefer-dedupe=true # Reduces node_modules size for all apps
node-linker=hoisted
shamefully-hoist=true
strict-peer-dependencies=false
legacy-peer-deps=true
resolution-mode=highest
build-from-source=true
platform=linux
arch=x64
public-hoist-pattern[]=*rollup*
public-hoist-pattern[]=*esbuild*
public-hoist-pattern[]=*webpack*
public-hoist-pattern[]=*types*
public-hoist-pattern[]=*vue*
public-hoist-pattern[]=*nuxt*
public-hoist-pattern[]=*vite*
public-hoist-pattern[]=@rollup/*
16 changes: 13 additions & 3 deletions apps/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ ARG NUXT_PUBLIC_SUPABASE_URL
ENV NX_CLOUD_ACCESS_TOKEN=${NX_CLOUD_ACCESS_TOKEN} \
NODE_ENV=production \
NUXT_PUBLIC_SUPABASE_URL=${NUXT_PUBLIC_SUPABASE_URL} \
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
ROLLUP_SKIP_NODE_RESOLVE=true \
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ROLLUP_NATIVE=false \
npm_config_build_from_source=true

# Install required build dependencies
RUN apt-get update && \
Expand All @@ -22,15 +24,23 @@ COPY nx.json ./
COPY tsconfig*.json ./
COPY .npmrc ./

# Pre-install specific platform dependencies
RUN npm install -g @rollup/rollup-linux-x64-gnu @rollup/rollup-linux-x64-musl --no-save

# Install root dependencies with platform specifics
RUN npm install --no-progress --platform=linux --arch=x64

# Copy only needed source files
COPY apps/app ./apps/app
COPY libs ./libs
COPY layers ./layers

# Install dependencies with platform specifics
RUN npm install --no-progress
# Install workspace dependencies
RUN npm install --workspaces

# Now copy source files
COPY . .

# Install nx and build
RUN npm install nx@latest -g
RUN nx reset
Expand Down

0 comments on commit 1b28215

Please sign in to comment.