<commit_before>import rimraf from 'rimraf';
import { resolve } from 'path';
import { promisify } from 'bluebird';
import { isDir, error } from '../util';
import runWebpack, { showStats, writeJsonStats } from '../lib/webpack/run-webpack';

export default async function (argv) {
	argv.src = argv._.pop() || argv.src;

	let cwd = resolve(argv.cwd);
	let modules = resolve(cwd, 'node_modules');

	if (!isDir(modules)) {
		return error('No `node_modules` found! Please run `npm install` before continuing.', 1);
	}

	if (argv.clean) {
		let dest = resolve(cwd, argv.dest);
		await Promise.promisify(rimraf)(dest);
	}

	let stats = await runWebpack(false, argv);

	showStats(stats);

	if (argv.json) {
		await writeJsonStats(stats);
	}
}<commit_msg>add `build` implicit `true` defaults<commit_after>import rimraf from 'rimraf';
import { resolve } from 'path';
import { promisify } from 'bluebird';
import { isDir, error } from '../util';
import runWebpack, { showStats, writeJsonStats } from '../lib/webpack/run-webpack';

export default async function (argv) {
	argv.src = argv._.pop() || argv.src;
	// add `default:true`s, `--no-*` disables
	argv.prerender = (argv.prerender === void 0);
	argv.production = (argv.production === void 0);

	let cwd = resolve(argv.cwd);
	let modules = resolve(cwd, 'node_modules');

	if (!isDir(modules)) {
		return error('No `node_modules` found! Please run `npm install` before continuing.', 1);
	}

	if (argv.clean === void 0) {
		let dest = resolve(cwd, argv.dest);
		await Promise.promisify(rimraf)(dest);
	}

	let stats = await runWebpack(false, argv);

	showStats(stats);

	if (argv.json) {
		await writeJsonStats(stats);
	}
}
{'fraction_non_alphanumeric': 0.16195063214930763, 'fraction_numerical': 0.0030102347983142685, 'mean_word_length': 4.413680781758957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6399202', 'n_tokens_mistral': 586, 'n_tokens_neox': 558, 'n_words': 156}