From 0e579ee9dce917c1b783cea5506315f78b1e0a00 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 20 Feb 2020 14:35:21 +1100 Subject: fix: emit when bundle contains single module (#4042) Fixes #4031 When a bundle contains a single module, we were incorrectly determining the module name, resulting in a non-functional bundle. This PR corrects that determination. --- cli/js/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/js') diff --git a/cli/js/util.ts b/cli/js/util.ts index e779fb5d7..faf4c99c6 100644 --- a/cli/js/util.ts +++ b/cli/js/util.ts @@ -306,7 +306,7 @@ export function normalizeString( export function commonPath(paths: string[], sep = "/"): string { const [first = "", ...remaining] = paths; if (first === "" || remaining.length === 0) { - return ""; + return first.substring(0, first.lastIndexOf(sep) + 1); } const parts = first.split(sep); -- cgit v1.2.3