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

Doc: By default no branch is generated, API sample code wrong #16

Closed pke closed 7 years ago

pke commented 7 years ago

https://github.com/pirelenito/git-revision-webpack-plugin#plugin-api

The first usage example shows BRANCH being used in the define plugin, but the call to new GitRevisionPlugin() doesn't include the branch: true option so no branch name is generated.

pirelenito commented 7 years ago

Sorry about the confusion in the documentation and API, but the .branch() api actually works without the flag being enabled.

You can check the implementation https://github.com/pirelenito/git-revision-webpack-plugin/blob/master/lib/index.js#L71

pke commented 7 years ago

By default it's false, I could see that. The example code in the readme is still wrong, isn't it? Ah so calling branch() directly will always perform the git command and return the branch, ok. Got it. You'd have to specify it in the options then why? So path substitution would work?

pirelenito commented 7 years ago

The option affects path substitution and creating the BRANCH file.

pke commented 7 years ago

Right, thanks! Great plugin. Will help to improve our customer services in connection with sentry.io a great step.