diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-02-20 14:35:21 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 22:35:21 -0500 |
commit | 0e579ee9dce917c1b783cea5506315f78b1e0a00 (patch) | |
tree | 28bffb2fc7a0f73adc59e98fc9633dfb491c448c /cli/js/util.ts | |
parent | 742a16b5069b2a6dee200d908df54fab77408581 (diff) |
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.
Diffstat (limited to 'cli/js/util.ts')
-rw-r--r-- | cli/js/util.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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); |