Skip to content
This repository has been archived by the owner on Oct 16, 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 eea1d26 commit 46aea0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions __tests__/test-app.js
Expand Up @@ -62,6 +62,7 @@ describe('Baumeister with default options', () => {
'build/webpack/config.optimization.js',
'build/webpack/config.output.js',
'build/webpack/config.plugins.js',
'build/webpack/config.stats.js',
'build/webpack/helpers.js'
]);
});
Expand Down
9 changes: 3 additions & 6 deletions app/templates/build/webpack.config.babel.js
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 app/templates/build/webpack/config.dev-server.js
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 app/templates/build/webpack/config.stats.js
@@ -0,0 +1,7 @@
export const stats = {
timings: true,
hash: false,
builtAt: false,
entrypoints: false,
children: false
};

0 comments on commit 46aea0b

Please sign in to comment.