Fix production build error with proper vendor chunk splitting
- Configure Vite to split vendor chunks (React, DOMPurify, video libs, Supabase) - Add manual chunk configuration to prevent duplicate module bundling - Clean Docker build cache and node_modules cache during build - Update Dockerfile to force clean rebuilds This should resolve the 'Identifier already declared' error in production caused by DOMPurify's @xmldom dependency being bundled multiple times. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,14 @@ WORKDIR /app
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
# Install dependencies with clean install
|
||||
RUN npm ci --prefer-offline --no-audit --force
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
# Clean any previous build artifacts and node_modules cache, then build
|
||||
RUN rm -rf dist node_modules/.cache && npm run build
|
||||
|
||||
# Production stage - Use a simple server that works with Coolify
|
||||
FROM node:18-alpine AS production
|
||||
|
||||
Reference in New Issue
Block a user