diff --git a/package.json b/package.json index 4cc169a..5535e2e 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/webpack.config.js b/webpack.config.js index ca697d1..d3e2c82 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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;