Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Commit

Permalink
feat: reduce noise in terminal (especially in watch mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischah committed Apr 3, 2018
1 parent b441132 commit 90a84bd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 3 additions & 6 deletions build/webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import {rules} from './webpack/config.module.rules';
import {output} from './webpack/config.output';
import {plugins} from './webpack/config.plugins';
import {optimization} from './webpack/config.optimization';
import {stats} from './webpack/config.stats';

const cliFlags = minimist(process.argv.slice(2));
const buildTarget = isDevMode() ? ' Development ' : ' Production ';

if (!cliFlags.json) {
console.log(chalk.yellow(stripIndents`Build target: ${chalk.bold.inverse(buildTarget)}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`));
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`));
}

module.exports = {
Expand All @@ -26,9 +27,5 @@ module.exports = {
plugins,
optimization,
mode: isDevMode() ? 'development' : 'production',
stats: {
timings: true,
hash: false,
builtAt: false
}
stats
};
9 changes: 8 additions & 1 deletion build/webpack/config.dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import path from 'path';

import {mainDirectories} from '../config';
import {isDevMode} from './helpers';
import {stats} from './config.stats';

export const devServer = {
contentBase: isDevMode() ? path.join(__dirname, '../', mainDirectories.dev) : path.join(__dirname, '../', mainDirectories.prod),
port: isDevMode() ? 3000 : 3001,
overlay: true
overlay: true,
stats: {
version: false,
assets: false,
modules: false,
...stats
}
};
7 changes: 7 additions & 0 deletions build/webpack/config.stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const stats = {
timings: true,
hash: false,
builtAt: false,
entrypoints: false,
children: false
};

0 comments on commit 90a84bd

Please sign in to comment.