Improve config check warning

This commit is contained in:
SleepWalker 2019-06-09 10:38:59 +03:00
parent a4b653a5a4
commit a69ae9d3c6

View File

@ -6,6 +6,7 @@ const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const loaderUtils = require('loader-utils'); const loaderUtils = require('loader-utils');
const chalk = require('chalk');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const cssUrl = require('webpack-utils/cssUrl'); const cssUrl = require('webpack-utils/cssUrl');
@ -24,7 +25,11 @@ let config = {};
try { try {
config = require('./config/env.js'); config = require('./config/env.js');
} catch (err) { } 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);
}
} }
/** /**