Skip to content

Commit

Permalink
feat(build): add stats flag
Browse files Browse the repository at this point in the history
This allows generating stats for webpack deps analysis
  • Loading branch information
dignifiedquire committed Aug 19, 2016
1 parent 0d30808 commit 8046edb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tasks/build/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const $ = require('gulp-load-plugins')()
const webpack = require('webpack')
const path = require('path')
const fs = require('fs')

const config = require('../../config/webpack')

Expand All @@ -11,6 +12,10 @@ const webpackDone = (done) => (err, stats) => {
throw new $.util.PluginError('webpack', err)
}

if ($.util.env.stats) {
fs.writeFileSync('stats.json', JSON.stringify(stats.toJson(), null, 2))
}

$.util.log('[webpack]', stats.toString({
modules: false,
colors: true,
Expand Down

0 comments on commit 8046edb

Please sign in to comment.