see https://nodejs.org/api/esm.html#hooks, need to figure out how this chaining works, but basically we return the format from resolve, put something like this after calling resolveWithEsBuild:
+ if (resolution?.url && forceESM(global.ImportTrackingConfig, resolution.url)) {
+ resolution.format = "module";
+ }