Closed wdunn001 closed 7 years ago
Hi, to get access to those functions, you must create an instance of the plugin as documented:
var gitRevisionPlugin = new GitRevisionPlugin()
module.exports = {
plugins: [
gitRevisionPlugin,
new webpack.DefinePlugin({ 'process.env': { 'ENV': JSON.stringify(isDevBuild ? 'Development' : 'Production'), 'VERSION': JSON.stringify(gitRevisionPlugin.version()) } })
]
}
The idea being that you would share the instance with webpack.
Cheers,
I'm closing this issue.
Let me know if you need anything else.
oh lord I totally missed that thank you! I think i just glossed over it thinking it was the require...
when I try to use
'VERSION': JSON.stringify(GitRevisionPlugin.version())
I get the following responseInner Exception 1: Exception: Call to Node module failed with error: TypeError: GitRevisionPlugin.version is not a function
I am using the code like thisnew webpack.DefinePlugin({ 'process.env': { 'ENV': JSON.stringify(isDevBuild ? 'Development' : 'Production'), 'VERSION': JSON.stringify(GitRevisionPlugin.version()) } })
new GitRevisionPlugin() does work on its own and writes the files.