From 45c62a2c766132a13c546b19025e9c1ef25bcd5b Mon Sep 17 00:00:00 2001 From: eric thul Date: Sat, 19 Nov 2016 13:57:32 -0500 Subject: Use emitError and emitWarning --- src/index.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index f3b2fde..7c29650 100644 --- a/src/index.js +++ b/src/index.js @@ -62,21 +62,6 @@ module.exports = function purescriptLoader(source, map) { psModuleMap: cache.psModuleMap } }) - - // add psc warnings to webpack compilation warnings - this._compiler.plugin('after-compile', (compilation, callback) => { - if (options.warnings && cache.warnings) { - compilation.warnings.unshift(`PureScript compilation:\n${cache.warnings}`) - cache.warnings = null; - } - - if (cache.errors) { - compilation.errors.unshift(`PureScript compilation:\n${cache.errors}`) - cache.errors = null; - } - - callback() - }) } const psModuleName = PsModuleMap.match(source) @@ -89,6 +74,8 @@ module.exports = function purescriptLoader(source, map) { jsPath: path.resolve(path.join(options.output, psModuleName, 'index.js')), options: options, cache: cache, + emitWarning: warning => this.emitWarning(warning), + emitError: error => this.emitError(error) } debug('loader called', psModule.name) -- cgit v1.2.3