diff --git a/next.config.mjs b/next.config.mjs index 8b3fbfa02..08f71a6a9 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -47,7 +47,16 @@ const nextConfig = { NEXT_PUBLIC_APP_VERSION: process.env.NEXT_PUBLIC_APP_VERSION || process.env.npm_package_version || 'dev', }, // Prevent webpack from restarting when .env files are touched via Docker volume mount - webpack: (config, { dev }) => { + webpack: (config, { dev, isServer }) => { + // Completely strip Next.js forced legacy polyfills for modern browser targets + if (!isServer) { + config.resolve.alias = { + ...config.resolve.alias, + 'next/dist/build/polyfills/polyfill-module': false, + 'next/dist/build/polyfills/polyfill-nomodule': false, + }; + } + if (dev) { config.watchOptions = { ...config.watchOptions, diff --git a/package.json b/package.json index 01a07983b..18a1b66dc 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "prepare": "husky", "preinstall": "npx only-allow pnpm" }, - "version": "2.2.50", + "version": "2.2.51", "pnpm": { "onlyBuiltDependencies": [ "@parcel/watcher",