From 54e6e82da874848ddc5d6eff571cd97388bdf301 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Alleaume Date: Mon, 20 May 2019 17:07:38 +0200 Subject: [PATCH 1/2] Make sure rollup output matching input --- src/build/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/build/index.ts b/src/build/index.ts index c4ff9a7d3..d4fe9c6c3 100644 --- a/src/build/index.ts +++ b/src/build/index.ts @@ -179,10 +179,11 @@ export async function build (input: string[] | Record, opts: Buil // Make sure the rollup output array is in the same order as input array const inputObjKeys = Object.keys(inputObj); - output.sort((a, b) => inputObjKeys.indexOf(a.name) - inputObjKeys.indexOf(b.name)); + const filteredOutput = output.filter(out => inputObjKeys.indexOf(out.name) !== -1); + filteredOutput.sort((a, b) => inputObjKeys.indexOf(a.name) - inputObjKeys.indexOf(b.name)); for (const [index, key] of inputObjKeys.entries()) { - const resolvedFile = path.resolve(opts.dir, output[index].fileName); + const resolvedFile = path.resolve(opts.dir, filteredOutput[index].fileName); let relMap = path.relative(mapBase, resolvedFile).replace(/\\/g, '/'); if (!relMap.startsWith('../')) relMap = './' + relMap; From 2cf8b78039ab24137c16ab5b63faeb43b85cdabe Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Alleaume Date: Tue, 21 May 2019 07:31:20 +0200 Subject: [PATCH 2/2] Update src/build/index.ts Co-Authored-By: Guy Bedford --- src/build/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/index.ts b/src/build/index.ts index d4fe9c6c3..53d066644 100644 --- a/src/build/index.ts +++ b/src/build/index.ts @@ -179,7 +179,7 @@ export async function build (input: string[] | Record, opts: Buil // Make sure the rollup output array is in the same order as input array const inputObjKeys = Object.keys(inputObj); - const filteredOutput = output.filter(out => inputObjKeys.indexOf(out.name) !== -1); + const filteredOutput = output.filter(out => out.isEntry); filteredOutput.sort((a, b) => inputObjKeys.indexOf(a.name) - inputObjKeys.indexOf(b.name)); for (const [index, key] of inputObjKeys.entries()) {