Improvements for web build (#3786)

* k

* improvements for web build
This commit is contained in:
pablonyx
2025-01-27 12:40:06 -08:00
committed by GitHub
parent e625884702
commit 118d2b52e6
2 changed files with 15 additions and 9 deletions

View File

@@ -18,6 +18,9 @@ FROM base AS builder
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
# Add NODE_OPTIONS argument
ARG NODE_OPTIONS
# pull in source code / package.json / package-lock.json # pull in source code / package.json / package-lock.json
COPY . . COPY . .
@@ -78,7 +81,8 @@ ENV NEXT_PUBLIC_GTM_ENABLED=${NEXT_PUBLIC_GTM_ENABLED}
ARG NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED ARG NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED
ENV NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED=${NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED} ENV NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED=${NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED}
RUN npx next build # Use NODE_OPTIONS in the build command
RUN NODE_OPTIONS="${NODE_OPTIONS}" npx next build
# Step 2. Production image, copy all the files and run next # Step 2. Production image, copy all the files and run next
FROM base AS runner FROM base AS runner

View File

@@ -86,14 +86,16 @@ const sentryWebpackPluginOptions = {
authToken: process.env.SENTRY_AUTH_TOKEN, authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !sentryEnabled, // Silence output when Sentry is disabled silent: !sentryEnabled, // Silence output when Sentry is disabled
dryRun: !sentryEnabled, // Don't upload source maps when Sentry is disabled dryRun: !sentryEnabled, // Don't upload source maps when Sentry is disabled
sourceMaps: { ...(sentryEnabled && {
include: ["./.next"], sourceMaps: {
ignore: ["node_modules"], include: ["./.next"],
urlPrefix: "~/_next", ignore: ["node_modules"],
stripPrefix: ["webpack://_N_E/"], urlPrefix: "~/_next",
validate: true, stripPrefix: ["webpack://_N_E/"],
cleanArtifacts: true, validate: true,
}, cleanArtifacts: true,
},
}),
}; };
// Export the module with conditional Sentry configuration // Export the module with conditional Sentry configuration