24 lines
852 B
JavaScript
Raw Normal View History

2016-08-18 11:41:13 +02:00
#!/usr/bin/env node
var shelljs = require('shelljs');
var animateProgress = require('./helpers/progress');
var chalk = require('chalk');
var addCheckMark = require('./helpers/checkmark');
var progress = animateProgress('Generating stats');
// Generate stats.json file with webpack
shelljs.exec(
2017-03-09 15:25:15 +01:00
'node node_modules/webpack/bin/webpack --config internals/webpack/webpack.prod.babel.js --profile --json > stats.json',
2016-08-18 11:41:13 +02:00
addCheckMark.bind(null, callback) // Output a checkmark on completion
);
// Called after webpack has finished generating the stats.json file
function callback() {
clearInterval(progress);
process.stdout.write(
'\n\nOpen ' + chalk.magenta('http://webpack.github.io/analyse/') + ' in your browser and upload the stats.json file!' +
chalk.blue('\n(Tip: ' + chalk.italic('CMD + double-click') + ' the link!)\n\n')
);
}