Commit 1ec1efa157cb5f3a76b78c33e4fff51612f4e688
Committed by
GitHub
Merge pull request #2421 from SergioCrisostomo/use-packagejson-version
use version from package.json
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
build/webpack.base.config.js
... | ... | @@ -3,6 +3,8 @@ |
3 | 3 | */ |
4 | 4 | const path = require('path'); |
5 | 5 | const webpack = require('webpack'); |
6 | +const package = require('../package.json'); | |
7 | + | |
6 | 8 | function resolve (dir) { |
7 | 9 | return path.join(__dirname, '..', dir); |
8 | 10 | } |
... | ... | @@ -66,6 +68,9 @@ module.exports = { |
66 | 68 | } |
67 | 69 | }, |
68 | 70 | plugins: [ |
69 | - new webpack.optimize.ModuleConcatenationPlugin() | |
71 | + new webpack.optimize.ModuleConcatenationPlugin(), | |
72 | + new webpack.DefinePlugin({ | |
73 | + 'process.env.VERSION': `'${package.version}'` | |
74 | + }), | |
70 | 75 | ] |
71 | 76 | }; | ... | ... |
src/index.js
... | ... | @@ -153,7 +153,7 @@ if (typeof window !== 'undefined' && window.Vue) { |
153 | 153 | } |
154 | 154 | |
155 | 155 | const API = { |
156 | - version: '2.7.2', | |
156 | + version: process.env.VERSION, // eslint-disable-line no-undef | |
157 | 157 | locale: locale.use, |
158 | 158 | i18n: locale.i18n, |
159 | 159 | install, | ... | ... |