aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2016-06-12 16:04:14 -0400
committereric thul <thul.eric@gmail.com>2016-06-12 16:04:14 -0400
commit0b853815ef14d35cedebc2c7806fd2f9ff9d5ab5 (patch)
tree75e135abd95c9fee60ef9d9ba7d35440fd2c1ddf
parent055d127bb9ca88c9bfcc7286a33f36f5ff6b4462 (diff)
downloadpurs-loader-0b853815ef14d35cedebc2c7806fd2f9ff9d5ab5.tar.gz
purs-loader-0b853815ef14d35cedebc2c7806fd2f9ff9d5ab5.tar.zst
purs-loader-0b853815ef14d35cedebc2c7806fd2f9ff9d5ab5.zip
Clear warnings and errors after use
Resolves #57
-rw-r--r--src/index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index fe1455b..c73fdd5 100644
--- a/src/index.js
+++ b/src/index.js
@@ -67,10 +67,12 @@ module.exports = function purescriptLoader(source, map) {
67 this._compiler.plugin('after-compile', (compilation, callback) => { 67 this._compiler.plugin('after-compile', (compilation, callback) => {
68 if (options.warnings && cache.warnings) { 68 if (options.warnings && cache.warnings) {
69 compilation.warnings.unshift(`PureScript compilation:\n${cache.warnings}`) 69 compilation.warnings.unshift(`PureScript compilation:\n${cache.warnings}`)
70 cache.warnings = null;
70 } 71 }
71 72
72 if (cache.errors) { 73 if (cache.errors) {
73 compilation.errors.unshift(`PureScript compilation:\n${cache.errors}`) 74 compilation.errors.unshift(`PureScript compilation:\n${cache.errors}`)
75 cache.errors = null;
74 } 76 }
75 77
76 callback() 78 callback()