From d962c7fa02f4dc4d3adc879313ce593e446dfb67 Mon Sep 17 00:00:00 2001
From: Sergio Crisostomo <sergiosbox@gmail.com>
Date: Tue, 14 Nov 2017 17:46:52 +0100
Subject: [PATCH] use version from package.json

---
 build/webpack.base.config.js | 7 ++++++-
 src/index.js                 | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/build/webpack.base.config.js b/build/webpack.base.config.js
index 262b6a4a..87944bc8 100644
--- a/build/webpack.base.config.js
+++ b/build/webpack.base.config.js
@@ -3,6 +3,8 @@
  */
 const path = require('path');
 const webpack = require('webpack');
+const package = require('../package.json');
+
 function resolve (dir) {
     return path.join(__dirname, '..', dir);
 }
@@ -66,6 +68,9 @@ module.exports = {
         }
     },
     plugins: [
-        new webpack.optimize.ModuleConcatenationPlugin()
+        new webpack.optimize.ModuleConcatenationPlugin(),
+        new webpack.DefinePlugin({
+            'process.env.VERSION': `'${package.version}'`
+        }),
     ]
 };
diff --git a/src/index.js b/src/index.js
index d4b88f34..6482b161 100644
--- a/src/index.js
+++ b/src/index.js
@@ -153,7 +153,7 @@ if (typeof window !== 'undefined' && window.Vue) {
 }
 
 const API = {
-    version: '2.7.2',
+    version: process.env.VERSION, // eslint-disable-line no-undef
     locale: locale.use,
     i18n: locale.i18n,
     install,