diff options
Diffstat (limited to 'cli/tests/testdata/compat/import_esm_from_cjs')
5 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/index.js new file mode 100644 index 000000000..4ba03e104 --- /dev/null +++ b/cli/tests/testdata/compat/import_esm_from_cjs/index.js @@ -0,0 +1 @@ +require("pure-cjs"); diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js new file mode 100644 index 000000000..35f7c3774 --- /dev/null +++ b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js @@ -0,0 +1,4 @@ +async function run() { + const _result = await import('pure-esm'); +} +run() diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json new file mode 100644 index 000000000..e854fd992 --- /dev/null +++ b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json @@ -0,0 +1,4 @@ +{ + "name": "pure-cjs", + "main": "./index.js" +} diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js new file mode 100644 index 000000000..898097cb5 --- /dev/null +++ b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js @@ -0,0 +1,2 @@ +import fs from 'node:fs'; +console.log(typeof fs.chmod); diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json new file mode 100644 index 000000000..a373d3ad9 --- /dev/null +++ b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json @@ -0,0 +1,5 @@ +{ + "name": "pure-esm", + "type": "module", + "main": "./index.js" +} |