soundcloud / git-sha-webpack-plugin

Tag your webpack bundles with a Git SHA linked to the latest commit on that bundle
MIT License
27 stars 7 forks source link

chunkgitsha not included in generated stats #2

Open joscarsson opened 9 years ago

joscarsson commented 9 years ago

First of all, thanks for a great plugin :)

I have a slight issue where the chunkgitsha does not seem to be included in the stats output (so I can't refer to it afterwards). I usually do something like:

var webpack = require('webpack');
var webpackConfig = require('../webpack-production.config');

webpack(webpackConfig, function(err, stats) {
  var jsonstats = stats.toJson({ hash: true, chunkgitsha: true });
  console.log('hash', jsonstats.hash); // this is the webpack compilation hash
  console.log('chunkgitsha', jsonstats.chunkgitsha); // this is undefined
});

Would it be possible to include that in stats somehow?

Also, it would be great with an option to just get the latest commit's sha instead of the latest commit sha that affected the bundle. Maybe another variable, [gitsha] in addition to [chunkgitsha]?

ezekielchentnik commented 8 years ago

filenames break when codesplitting