pirelenito / git-revision-webpack-plugin

🏗 Webpack plugin that generates VERSION and COMMITHASH files during build
https://www.npmjs.com/package/git-revision-webpack-plugin
MIT License
358 stars 48 forks source link

Fix issue caused by assuming webpack context would contain the git repo #3

Closed pirelenito closed 8 years ago

pirelenito commented 8 years ago

That won’t necessarily be true, and most likely, won’t.

So fallback to use the working directory of the Node process by default and allow customising its location if needed via a gitWorkTree option.

This should fix:

        hash: childCompilation.hash,
                              ^

TypeError: Cannot read property 'hash' of undefined