From cfdd3aa733d8afb907e8886a332c60f1a3899f41 Mon Sep 17 00:00:00 2001 From: Xinyu Liu Date: Sat, 28 Apr 2018 02:17:14 +0800 Subject: [PATCH] chore: show warnings in build debug mode --- lib/build.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/build.js b/lib/build.js index cd9b67ef7b..a904aa7ba0 100644 --- a/lib/build.js +++ b/lib/build.js @@ -103,6 +103,11 @@ module.exports = async function build (sourceDir, cliOptions = {}) { reject(new Error(`Failed to compile with errors.`)) return } + if (cliOptions.debug && stats.hasWarnings()) { + stats.toJson().warnings.forEach(warning => { + console.warn(warning) + }) + } resolve(stats.toJson({ modules: false })) }) })