From e0f17c20bf39e9b24559b58bcaee39ae833ed348 Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Wed, 27 Nov 2024 14:39:15 +0100 Subject: [PATCH] fix(bundling): rspack should allow ES config module imports --- packages/rspack/src/utils/resolve-user-defined-rspack-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rspack/src/utils/resolve-user-defined-rspack-config.ts b/packages/rspack/src/utils/resolve-user-defined-rspack-config.ts index 24c612296a9ec..809a4b03c933d 100644 --- a/packages/rspack/src/utils/resolve-user-defined-rspack-config.ts +++ b/packages/rspack/src/utils/resolve-user-defined-rspack-config.ts @@ -18,7 +18,7 @@ export function resolveUserDefinedRspackConfig( // Don't transpile non-TS files. This prevents workspaces libs from being registered via tsconfig-paths. // There's an issue here with Nx workspace where loading plugins from source (via tsconfig-paths) can lead to errors. if (!/\.(ts|mts|cts)$/.test(path)) { - return require(path); + return import(path); } const cleanupTranspiler = registerTsProject(tsConfig);