aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>2018-12-03 11:39:56 +0100
committerCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>2018-12-03 11:57:30 +0100
commitd8567b87b91abac0a428874cf5fdebb1b0d90ef0 (patch)
tree3302af22e82ee6412511d45673ddec67c244cd3f
parentf9d5f2faaa11b31661de1a1fcdad4ab51e8ef5fe (diff)
downloadpurs-loader-d8567b87b91abac0a428874cf5fdebb1b0d90ef0.tar.gz
purs-loader-d8567b87b91abac0a428874cf5fdebb1b0d90ef0.tar.zst
purs-loader-d8567b87b91abac0a428874cf5fdebb1b0d90ef0.zip
Allow previous loaders to extract dependencies to watch from errors
-rw-r--r--src/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index fce6394..ec9af5f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -217,6 +217,14 @@ module.exports = function purescriptLoader(source, map) {
217 this.addDependency(resolved); 217 this.addDependency(resolved);
218 } 218 }
219 } 219 }
220
221 if (typeof this.extractPursDependenciesFromError === 'function') {
222 const dependencies = this.extractPursDependenciesFromError(error) || [];
223
224 for (const dep of dependencies) {
225 this.addDependency(dep);
226 }
227 }
220 } 228 }
221 229
222 CACHE_VAR.errors.push(pscMessage); 230 CACHE_VAR.errors.push(pscMessage);