#242: reduce npm verbosity in containers and in CI

This commit is contained in:
SleepWalker 2016-12-04 15:12:36 +02:00
parent 70db8d05e5
commit df11c85caf
2 changed files with 25 additions and 2 deletions

View File

@ -8,12 +8,15 @@
"license": "UNLICENSED",
"repository": "git@gitlab.ely.by:elyby/accounts.git",
"scripts": {
"start": "rm -rf dist/ && npm run build:dll && webpack-dev-server --progress --colors",
"start": "npm run clean && npm run build:dll && webpack-dev-server --progress --colors",
"clean": "rm -rf dist/",
"up": "npm update",
"test": "npm run build:dll && karma start ./karma.conf.js",
"lint": "eslint ./src",
"i18n": "babel-node ./scripts/i18n-collect.js",
"build": "rm -rf dist/ && webpack --progress --colors -p",
"build": "npm run clean && npm run build:webpack -- --progress",
"build:webpack": "webpack --colors -p",
"build:quite": "npm run clean && npm run build:webpack -- --quite",
"build:dll": "node ./scripts/build-dll.js"
},
"dependencies": {

View File

@ -38,6 +38,8 @@ const isProduction = process.argv.some((arg) => arg === '-p');
const isTest = process.argv.some((arg) => arg.indexOf('karma') !== -1);
const isDockerized = !!process.env.DOCKERIZED;
const isCI = !!process.env.CI;
const isSilent = isCI || process.argv.some((arg) => /quite/.test(arg));
process.env.NODE_ENV = isProduction ? 'production' : 'development';
if (isTest) {
@ -288,4 +290,22 @@ if (isDockerized) {
webpackConfig.devServer.host = '0.0.0.0';
}
if (isSilent) {
webpackConfig.stats = {
hash: false,
version: false,
timings: true,
assets: false,
chunks: false,
modules: false,
reasons: false,
children: false,
source: false,
errors: true,
errorDetails: true,
warnings: false,
publicPath: false
};
}
module.exports = webpackConfig;