method
bun.PluginBuilder.onResolve
): this;
Register a callback to resolve imports matching a filter and/or namespace
@param constraints
The constraints to apply the plugin to
@param callback
The callback to handle the import
@returns
this for method chaining
Bun.plugin({
setup(builder) {
builder.onResolve({ filter: /^wat$/ }, (args) => {
return { path: "/tmp/woah.js" };
});
},
});