mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
17 lines
474 B
TypeScript
17 lines
474 B
TypeScript
import { BunPlugin } from "bun";
|
|
|
|
globalThis.pluginLoaded = true;
|
|
|
|
export default {
|
|
name: "long-bundler-plugin",
|
|
setup(build) {
|
|
build.onResolve({ filter: /frontend/ }, async args => {
|
|
return { path: args.path, namespace: "frontend" };
|
|
});
|
|
build.onLoad({ filter: /frontend/, namespace: "frontend" }, async args => {
|
|
await globalThis.callback();
|
|
return { loader: "tsx", contents: "console.log('hello')" };
|
|
});
|
|
},
|
|
} satisfies BunPlugin;
|