From f091d1ad69b4e5217ae3272b641171781a372c4f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 13 Nov 2024 10:10:09 -0500 Subject: feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though. --- tests/specs/run/import_common_js/index.cjs | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/specs/run/import_common_js/index.cjs') diff --git a/tests/specs/run/import_common_js/index.cjs b/tests/specs/run/import_common_js/index.cjs index 18caf81e9..0026e237d 100644 --- a/tests/specs/run/import_common_js/index.cjs +++ b/tests/specs/run/import_common_js/index.cjs @@ -1,9 +1,7 @@ const process = require("process"); -const a = require("./a"); console.log(process.cwd()); module.exports = { cwd: process.cwd, - foobar: a.foobar, }; -- cgit v1.2.3