From b70f520ebc59d123c114b76013a233c4250227e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 22 Nov 2022 20:09:30 +0100 Subject: fix: Make npm packages works with import maps (#16754) Co-authored-by: David Sherret --- cli/tests/testdata/npm/import_map/import_map.json | 3 ++- cli/tests/testdata/npm/import_map/main.js | 3 +++ cli/tests/testdata/npm/import_map/main.out | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'cli/tests') 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 -- cgit v1.2.3