When pluginData was specified, memory usage increased with each rebuild.
main.mjs
import { context } from "esbuild";
const namespace = "testing";
const ctx = await context({
stdin: {
contents: `import "testing";`,
},
plugins: [
{
name: "testing",
setup(build) {
build.onResolve({ filter: /^testing$/ }, () => {
return { path: "testing", namespace, pluginData: { value: "test" } };
});
build.onLoad({ filter: /.*/, namespace }, (args) => {
return { contents: "console.log(0);" };
});
},
},
],
write: false,
format: "esm",
bundle: true,
});
setInterval(async () => {
await ctx.rebuild();
}, 100);
If you run this, you will observe the Object usage increasing over time.
The following images show a comparison of snapshots at two points in time:

When
pluginDatawas specified, memory usage increased with each rebuild.main.mjs
If you run this, you will observe the
Objectusage increasing over time.The following images show a comparison of snapshots at two points in time: