You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the tinyglobby change was introduced we have been seeing our output files change between builds.
In a monorepo project we have multiple entrypoints and since 8.3.0 of tsup we have been seeing the resulting output files change between subsequent builds, primarily due to chunk names changing.
Running yarn bundle over and over will cause at least two files to change each time.
e.g.
Running yarn bundle against the main branch of my reproduction causes one of the index files to diff as:
--- import{b as i}from"../chunk-BJMENOML.mjs";import{a as o}from"../chunk-6VRBJZPP.mjs";import{a as r,b as t,d as m}from"../chunk-V3Q6A3RL.mjs";async function n(){t("world 4"),o("world 4"),o(`what - ${i}`)}r(n,"main");m(import.meta.url,n);export{n as main};
+++
import{a as o}from"../chunk-6VRBJZPP.mjs";import{b as i}from"../chunk-BJMENOML.mjs";import{a as r,b as t,d as m}from"../chunk-V3Q6A3RL.mjs";async function n(){t("world 4"),o("world 4"),o(`what - ${i}`)}r(n,"main");m(import.meta.url,n);export{n as main};
And then running it a second time gives
import{b as i}from"../chunk-BJMENOML.mjs";import{a as o}from"../chunk-6VRBJZPP.mjs";import{a as r,b as t,d as m}from"../chunk-V3Q6A3RL.mjs";async function n(){t("world 4"),o("world 4"),o(`what - ${i}`)}r(n,"main");m(import.meta.url,n);export{n as main};
so back to the original.
This will then flip flop back and forth between these two outputs.
After hacking this line in node_modules directly to sort the result of the glob call: options.entry = (await _tinyglobby.glob.call(void 0, entry)).sort();
the issue appears fixed.
I have not raised a PR for this as I am not fully across what the implications of sorting the glob output would be.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
Since the
tinyglobby
change was introduced we have been seeing our output files change between builds.In a monorepo project we have multiple entrypoints and since 8.3.0 of tsup we have been seeing the resulting output files change between subsequent builds, primarily due to chunk names changing.
I have set up a minimal reproduction of the issue here:
https://github.com/phcyso/tsup_glob_bug_repro
Running
yarn bundle
over and over will cause at least two files to change each time.e.g.
Running
yarn bundle
against the main branch of my reproduction causes one of the index files to diff as:And then running it a second time gives
so back to the original.
This will then flip flop back and forth between these two outputs.
We did some digging and this appears to be the culprit:
https://github.com/egoist/tsup/blob/main/src/index.ts#L111
After hacking this line in node_modules directly to sort the result of the
glob
call:options.entry = (await _tinyglobby.glob.call(void 0, entry)).sort();
the issue appears fixed.
I have not raised a PR for this as I am not fully across what the implications of sorting the glob output would be.
Upvote & Fund
The text was updated successfully, but these errors were encountered: