Skip to content

Commit

Permalink
Try closing the bundle again
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 26, 2023
1 parent 65c18ed commit c811f23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/watch/watch.ts
Expand Up @@ -209,6 +209,7 @@ export class Task {
this.updateWatchedFiles(result);
if (!this.skipWrite) {
await Promise.all(this.outputs.map(output => result!.write(output)));
await result.close();
if (this.closed) {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions test/watch/index.js
Expand Up @@ -1387,6 +1387,7 @@ describe('rollup.watch', () => {
const watchChangeIds = new Set();
const buildEndFile = resolve('test/_tmp/input/buildEnd');
const buildStartFile = resolve('test/_tmp/input/buildStart');
const closeBundleFile = resolve('test/_tmp/input/closeBundle');
const generateBundleFile = resolve('test/_tmp/input/generateBUndle');
const loadFile = resolve('test/_tmp/input/load');
const moduleParsedFile = resolve('test/_tmp/input/moduleParsed');
Expand All @@ -1398,6 +1399,7 @@ describe('rollup.watch', () => {
const watchFiles = [
buildEndFile,
buildStartFile,
closeBundleFile,
generateBundleFile,
loadFile,
moduleParsedFile,
Expand Down Expand Up @@ -1425,6 +1427,9 @@ describe('rollup.watch', () => {
buildStart() {
this.addWatchFile(buildStartFile);
},
closeBundle() {
this.addWatchFile(closeBundleFile);
},
generateBundle() {
this.addWatchFile(generateBundleFile);
},
Expand Down

0 comments on commit c811f23

Please sign in to comment.