From a69ae9d3c6b4acd0342ec973f85d96d5d0a74011 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sun, 9 Jun 2019 10:38:59 +0300 Subject: [PATCH] Improve config check warning --- webpack.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index a774240..5e4bf18 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ const path = require('path'); const webpack = require('webpack'); const loaderUtils = require('loader-utils'); +const chalk = require('chalk'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const cssUrl = require('webpack-utils/cssUrl'); @@ -24,7 +25,11 @@ let config = {}; try { config = require('./config/env.js'); } catch (err) { - console.error('\n\n===\nCan not find config/env.js. Running with defaults\n===\n\n', err); + console.log(chalk.yellow('\nCan not find config/env.js. Running with defaults\n\n')); + + if (err.code !== 'MODULE_NOT_FOUND') { + console.error(err); + } } /**