From d6b1d60a792b4c30494f0561accb2ce1c4f07530 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Thu, 3 Mar 2022 09:44:43 +0100 Subject: [PATCH] fix: remove .ts and {platform}.ts from resolve rules --- packages/webpack5/src/configuration/base.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/webpack5/src/configuration/base.ts b/packages/webpack5/src/configuration/base.ts index 900c82d7d..862485417 100644 --- a/packages/webpack5/src/configuration/base.ts +++ b/packages/webpack5/src/configuration/base.ts @@ -237,6 +237,10 @@ export default function (config: Config, env: IWebpackEnv = _env): Config { configFile: resolve(__dirname, '../stubs/tsconfig.default.json'), context: getProjectRootPath(), }; + + // if the project doesn't have a ts config - we don't want to automatically resolve to .ts files + // in these cases the file would need to be explicitly imported with the .ts extension to be processed. + config.resolve.extensions.delete(`.${platform}.ts`).delete('.ts'); } // set up ts support