Merge pull request #2421 from SergioCrisostomo/use-packagejson-version

use version from package.json
This commit is contained in:
Aresn 2017-11-15 20:27:51 -06:00 committed by GitHub
commit 1ec1efa157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,8 @@
*/ */
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const package = require('../package.json');
function resolve (dir) { function resolve (dir) {
return path.join(__dirname, '..', dir); return path.join(__dirname, '..', dir);
} }
@ -66,6 +68,9 @@ module.exports = {
} }
}, },
plugins: [ plugins: [
new webpack.optimize.ModuleConcatenationPlugin() new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
'process.env.VERSION': `'${package.version}'`
}),
] ]
}; };

View file

@ -153,7 +153,7 @@ if (typeof window !== 'undefined' && window.Vue) {
} }
const API = { const API = {
version: '2.7.2', version: process.env.VERSION, // eslint-disable-line no-undef
locale: locale.use, locale: locale.use,
i18n: locale.i18n, i18n: locale.i18n,
install, install,