diff --git a/lib/pipeline/webpackProcess.js b/lib/pipeline/webpackProcess.js index 847c278f..c701a857 100644 --- a/lib/pipeline/webpackProcess.js +++ b/lib/pipeline/webpackProcess.js @@ -3,19 +3,10 @@ const fs = require('../core/fs'); const ProcessWrapper = require('../core/processes/processWrapper'); const webpack = require('webpack'); const writeFile = require('util').promisify(require('fs').writeFile); +const {errorMessage} = require('../utils/utils'); let webpackProcess; -function errorMessage(e) { - if (typeof e === 'string') { - return e; - } else if (e && e.message) { - return e.message; - } else { - return e; - } -} - class WebpackProcess extends ProcessWrapper { constructor(options) { super(options); diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 1f95b4ed..764237e2 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -458,6 +458,16 @@ function interceptLogs(consoleContext, logger) { }; } +function errorMessage(e) { + if (typeof e === 'string') { + return e; + } else if (e && e.message) { + return e.message; + } else { + return e; + } +} + module.exports = { joinPath, dirname, @@ -499,5 +509,6 @@ module.exports = { groupBy, sample, last, - interceptLogs + interceptLogs, + errorMessage };