Closed
Description
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.
node --inspect main.mjs
The following images show a comparison of snapshots at two points in time:
Metadata
Assignees
Labels
No labels