Commit ded9d645 authored by Reza Sahebgharan's avatar Reza Sahebgharan

appversion major minor patch

parent 0fd20d52
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
<div>Version: {{Version}}</div> <div>Version: {{Version}}</div>
<div>CommitHash:{{CommitHash}}</div> <div>CommitHash:{{CommitHash}}</div>
<div>BRANCH:{{Branch}}</div> <div>BRANCH:{{Branch}}</div>
<div>MAJOR:{{Major}}</div>
<div>MINOR:{{Minor}}</div>
<div>PATCH:{{Patch}}</div>
</div> </div>
</template> </template>
...@@ -12,7 +18,10 @@ export default { ...@@ -12,7 +18,10 @@ export default {
return { return {
Version: VERSION, Version: VERSION,
CommitHash: COMMITHASH, CommitHash: COMMITHASH,
Branch: BRANCH Branch: BRANCH,
Major: MAJOR,
Minor: MINOR,
Patch: PATCH
}; };
} }
}; };
......
...@@ -9,6 +9,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); ...@@ -9,6 +9,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin'); const GitRevisionPlugin = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin(); const gitRevisionPlugin = new GitRevisionPlugin();
const clientConfig = { const clientConfig = {
entry: './client/main.js', entry: './client/main.js',
// output: { // output: {
...@@ -160,6 +161,9 @@ const clientConfig = { ...@@ -160,6 +161,9 @@ const clientConfig = {
'VERSION': JSON.stringify(gitRevisionPlugin.version()), 'VERSION': JSON.stringify(gitRevisionPlugin.version()),
'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()), 'COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'BRANCH': JSON.stringify(gitRevisionPlugin.branch()), 'BRANCH': JSON.stringify(gitRevisionPlugin.branch()),
"MAJOR": (gitRevisionPlugin.version().split("-")[0].split(".")[0].toString().substr(1)),
"MINOR": (gitRevisionPlugin.version()).split("-")[0].split(".")[1],
"PATCH": (gitRevisionPlugin.version()).split("-")[0].split(".")[2]
}) })
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment