diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index ec9af5f..0b4ecf8 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -190,6 +190,8 @@ module.exports = function purescriptLoader(source, map) { | |||
190 | }, | 190 | }, |
191 | emitError: pscMessage => { | 191 | emitError: pscMessage => { |
192 | if (pscMessage.length) { | 192 | if (pscMessage.length) { |
193 | const modules = []; | ||
194 | |||
193 | const matchErrorsSeparator = /\n(?=Error)/; | 195 | const matchErrorsSeparator = /\n(?=Error)/; |
194 | const errors = pscMessage.split(matchErrorsSeparator); | 196 | const errors = pscMessage.split(matchErrorsSeparator); |
195 | for (const error of errors) { | 197 | for (const error of errors) { |
@@ -218,6 +220,11 @@ module.exports = function purescriptLoader(source, map) { | |||
218 | } | 220 | } |
219 | } | 221 | } |
220 | 222 | ||
223 | const desc = { | ||
224 | name: baseModuleName, | ||
225 | filename: baseModulePath | ||
226 | }; | ||
227 | |||
221 | if (typeof this.extractPursDependenciesFromError === 'function') { | 228 | if (typeof this.extractPursDependenciesFromError === 'function') { |
222 | const dependencies = this.extractPursDependenciesFromError(error) || []; | 229 | const dependencies = this.extractPursDependenciesFromError(error) || []; |
223 | 230 | ||
@@ -225,9 +232,11 @@ module.exports = function purescriptLoader(source, map) { | |||
225 | this.addDependency(dep); | 232 | this.addDependency(dep); |
226 | } | 233 | } |
227 | } | 234 | } |
235 | |||
236 | modules.push(desc); | ||
228 | } | 237 | } |
229 | 238 | ||
230 | CACHE_VAR.errors.push(pscMessage); | 239 | CACHE_VAR.errors.push(Object.assign(new Error(pscMessage), { modules })); |
231 | } | 240 | } |
232 | } | 241 | } |
233 | } | 242 | } |