-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Description
What version of Bun is running?
1.3.1+89fa0f343
What platform is your computer?
Linux 6.8.12-16-pve x86_64 unknown
What steps can reproduce the bug?
When using a plugin that utilizes onLoad, it will render all subsequent await import watches ineffective, preventing them from restarting upon changes.
- Create index.ts
import { plugin as registerPlugin } from 'bun';
console.log('index', Date.now());
// Register plugin
registerPlugin({
name: 'plugin',
setup(builder) {
builder.onLoad(
{ filter: /.*/ },
async ({ path }) => {
return {
contents: await Bun.file(path).text(),
loader: 'ts',
};
},
);
},
});
await import('./a');- Create a.ts
console.warn('file a', Date.now());- run watch mode
bun --watch run ./index.tsNow save a.ts file, nothing happened.
What is the expected behavior?
Any changes to files imported via import should trigger an automatic restart.
What do you see instead?
No automatic restart.
Additional information
No response