From 52df9634c481c41f9cb8d0f76df057962fa6087c Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Mon, 18 Sep 2023 09:57:51 -0400 Subject: [PATCH] fix(webpack): set `module: true` for swcMinify --- e2e/web/src/web.test.ts | 3 +-- packages/webpack/src/utils/with-nx.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/web/src/web.test.ts b/e2e/web/src/web.test.ts index ff99ec6582c7e..f0ccc330303fb 100644 --- a/e2e/web/src/web.test.ts +++ b/e2e/web/src/web.test.ts @@ -25,8 +25,7 @@ describe('Web Components Applications', () => { beforeEach(() => newProject()); afterEach(() => cleanupProject()); - // TODO Re-enable this when it is passing. - xit('should be able to generate a web app', async () => { + it('should be able to generate a web app', async () => { const appName = uniq('app'); runCLI( `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` diff --git a/packages/webpack/src/utils/with-nx.ts b/packages/webpack/src/utils/with-nx.ts index 7261e10d1e40d..3c140326eb07f 100644 --- a/packages/webpack/src/utils/with-nx.ts +++ b/packages/webpack/src/utils/with-nx.ts @@ -271,6 +271,7 @@ export function withNx(pluginOptions?: WithNxOptions): NxWebpackPlugin { minify: TerserPlugin.swcMinify, // `terserOptions` options will be passed to `swc` terserOptions: { + module: true, mangle: false, }, }),