From 38d23ca9dba1ae04536ae2dc7293db153b111aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gautier=20Ben=20A=C3=AFm?= Date: Tue, 24 Jun 2025 16:24:03 +0200 Subject: [PATCH 1/3] feat: ensure multi-entry is deterministic --- packages/multi-entry/src/index.js | 4 +++- packages/multi-entry/test/test.mjs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/multi-entry/src/index.js b/packages/multi-entry/src/index.js index dec066ac4..c53f6e8fd 100755 --- a/packages/multi-entry/src/index.js +++ b/packages/multi-entry/src/index.js @@ -60,7 +60,9 @@ export default function multiEntry(conf = {}) { buildStart(options) { const patterns = config.include.concat(config.exclude.map((pattern) => `!${pattern}`)); const entries = patterns.length - ? matched(patterns, { realpath: true }).then((paths) => paths.map(exporter).join('\n')) + ? matched(patterns, { realpath: true }).then((paths) => + paths.sort().map(exporter).join('\n') + ) : Promise.resolve(''); virtualisedEntry = virtual({ [options.input]: entries }); diff --git a/packages/multi-entry/test/test.mjs b/packages/multi-entry/test/test.mjs index 9addd6dad..399062053 100755 --- a/packages/multi-entry/test/test.mjs +++ b/packages/multi-entry/test/test.mjs @@ -131,3 +131,19 @@ test('makes a bundle with entryFileName as the output.entryFileName when preserv t.truthy(nonVirtualFiles.find(({ fileName }) => fileName === 'entry-0.js')); t.truthy(nonVirtualFiles.find(({ fileName }) => fileName === 'entry-1.js')); }); + +test('deterministic output, regardless of input order', async (t) => { + const bundle1 = await rollup({ + input: 'test/fixtures/{0,1}.js', + plugins: [multiEntry()] + }); + const code1 = await getCode(bundle1); + + const bundle2 = await rollup({ + input: 'test/fixtures/{1,0}.js', + plugins: [multiEntry()] + }); + const code2 = await getCode(bundle2); + + t.is(code1, code2); +}); From 79cb39124bcf620b9ded0ecf944dc54c8118e4e0 Mon Sep 17 00:00:00 2001 From: Andrew Powell Date: Sat, 4 Oct 2025 12:38:46 -0400 Subject: [PATCH 2/3] bump workflows --- packages/multi-entry/test/test.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/multi-entry/test/test.mjs b/packages/multi-entry/test/test.mjs index 399062053..40a122dc2 100755 --- a/packages/multi-entry/test/test.mjs +++ b/packages/multi-entry/test/test.mjs @@ -9,6 +9,8 @@ import multiEntry from 'current-package'; import { getCode } from '../../../util/test.js'; +console.log('kicking github to run workflows because its buggy has hell now thanks microsoft'); + test('takes a single file as input', async (t) => { const bundle = await rollup({ input: 'test/fixtures/0.js', plugins: [multiEntry()] }); const code = await getCode(bundle); From a6867841cd0ba8946fed03c4eed0ea7ca264c754 Mon Sep 17 00:00:00 2001 From: Andrew Powell Date: Sat, 4 Oct 2025 12:39:14 -0400 Subject: [PATCH 3/3] undo bump change --- packages/multi-entry/test/test.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/multi-entry/test/test.mjs b/packages/multi-entry/test/test.mjs index 40a122dc2..399062053 100755 --- a/packages/multi-entry/test/test.mjs +++ b/packages/multi-entry/test/test.mjs @@ -9,8 +9,6 @@ import multiEntry from 'current-package'; import { getCode } from '../../../util/test.js'; -console.log('kicking github to run workflows because its buggy has hell now thanks microsoft'); - test('takes a single file as input', async (t) => { const bundle = await rollup({ input: 'test/fixtures/0.js', plugins: [multiEntry()] }); const code = await getCode(bundle);