Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
prevent infinite build loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jan 6, 2017
1 parent e016773 commit 4866aa7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/index.js
Expand Up @@ -73,16 +73,15 @@ export default function watch ( rollup, options ) {
rebuildScheduled = true;

timeout = setTimeout( () => {
if ( !building ) {
rebuildScheduled = false;
build();
}
if ( !building ) build();
}, 50 );
}

function build () {
if ( building || closed ) return;

rebuildScheduled = false;

let start = Date.now();
let initial = !watching;
if ( cache ) options.cache = cache;
Expand Down

0 comments on commit 4866aa7

Please sign in to comment.