diff --git a/packages/webpack/src/utils/with-web.ts b/packages/webpack/src/utils/with-web.ts index 2b47f973eb859..ff50d9839e773 100644 --- a/packages/webpack/src/utils/with-web.ts +++ b/packages/webpack/src/utils/with-web.ts @@ -401,10 +401,7 @@ export function withWeb(pluginOptions: WithWebOptions = {}): NxWebpackPlugin { config.plugins.push(...plugins); - config.resolve.mainFields = [ - 'browser', - ...(config.resolve.mainFields ?? []), - ]; + config.resolve.mainFields = ['browser', 'module', 'main']; config.module = { ...config.module,