use version from package.json

This commit is contained in:
Sergio Crisostomo 2017-11-14 17:46:52 +01:00
parent d291e8152b
commit d962c7fa02
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,