diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-22 20:09:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 20:09:30 +0100 |
commit | b70f520ebc59d123c114b76013a233c4250227e6 (patch) | |
tree | 44476e016d44a167d7020a8257098651e5f4d25c /cli/tests | |
parent | f077c4f248ab96c1ba67dd24d6573cc9f9a0a1ad (diff) |
fix: Make npm packages works with import maps (#16754)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/testdata/npm/import_map/import_map.json | 3 | ||||
-rw-r--r-- | cli/tests/testdata/npm/import_map/main.js | 3 | ||||
-rw-r--r-- | cli/tests/testdata/npm/import_map/main.out | 3 |
3 files changed, 8 insertions, 1 deletions
diff --git a/cli/tests/testdata/npm/import_map/import_map.json b/cli/tests/testdata/npm/import_map/import_map.json index a7ed13b82..1c3baacd1 100644 --- a/cli/tests/testdata/npm/import_map/import_map.json +++ b/cli/tests/testdata/npm/import_map/import_map.json @@ -1,5 +1,6 @@ { "imports": { - "chalk": "npm:chalk@5" + "chalk": "npm:chalk@5", + "@denotest/": "npm:/@denotest/dual-cjs-esm/" } } diff --git a/cli/tests/testdata/npm/import_map/main.js b/cli/tests/testdata/npm/import_map/main.js index fe7ef549a..e354b7e92 100644 --- a/cli/tests/testdata/npm/import_map/main.js +++ b/cli/tests/testdata/npm/import_map/main.js @@ -1,7 +1,10 @@ import chalk from "chalk"; +import { getSubPathKind } from "@denotest/subpath/main.mjs"; console.log(chalk.green("chalk import map loads")); export function test(value) { return chalk.red(value); } + +console.log(getSubPathKind()); diff --git a/cli/tests/testdata/npm/import_map/main.out b/cli/tests/testdata/npm/import_map/main.out index ef3f4e22b..b5b67651e 100644 --- a/cli/tests/testdata/npm/import_map/main.out +++ b/cli/tests/testdata/npm/import_map/main.out @@ -1,3 +1,6 @@ +Download http://localhost:4545/npm/registry/@denotest/dual-cjs-esm Download http://localhost:4545/npm/registry/chalk +Download http://localhost:4545/npm/registry/@denotest/dual-cjs-esm/1.0.0.tgz Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz chalk import map loads +esm |