Skip to content

Commit

Permalink
Merge pull request #47 from Conduitry/use-addwatchfile
Browse files Browse the repository at this point in the history
use this.addWatchFile when present
  • Loading branch information
Rich-Harris committed Dec 31, 2018
2 parents f68fd5a + 22d8345 commit 8c26de5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ module.exports = function svelte(options = {}) {
cssLookup.set(fname, compiled.css);
}

compiled.js.dependencies = dependencies;
if (this.addWatchFile) {
dependencies.forEach(dependency => this.addWatchFile(dependency));
} else {
compiled.js.dependencies = dependencies;
}

return compiled.js;
});
Expand Down

0 comments on commit 8c26de5

Please sign in to comment.