summaryrefslogtreecommitdiff
path: root/tests/specs/run/import_common_js/a.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-05 08:59:12 +0100
committerGitHub <noreply@github.com>2024-09-05 07:59:12 +0000
commitdfc5eec43c481b1eeaa0ad069aeba8b7559d4440 (patch)
tree84e3bc63388a90163ccd4008165bd09761be12a7 /tests/specs/run/import_common_js/a.js
parent4554ab6aefb158f2d0a8a5ae5bb3d748e123fb00 (diff)
feat: Allow importing .cjs files (#25426)
This commit adds support for executing top-level `.cjs` files, as well as import `.cjs` files from within npm packages. This works only for `.cjs` files, the contents of sibling `package.json` are not consulted for the `"type"` field. Closes https://github.com/denoland/deno/issues/25384 --------- Signed-off-by: David Sherret <dsherret@users.noreply.github.com> Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'tests/specs/run/import_common_js/a.js')
-rw-r--r--tests/specs/run/import_common_js/a.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/specs/run/import_common_js/a.js b/tests/specs/run/import_common_js/a.js
new file mode 100644
index 000000000..c465ab588
--- /dev/null
+++ b/tests/specs/run/import_common_js/a.js
@@ -0,0 +1,7 @@
+function foobar() {
+ console.log("foobar");
+}
+
+module.exports = {
+ foobar,
+};