diff --git a/src/common/Global.js b/src/common/Global.js index e34b249b..c2bae9e3 100644 --- a/src/common/Global.js +++ b/src/common/Global.js @@ -1,5 +1,8 @@ +/* global GG_EDITOR_VERSION */ + const global = { trackable: process.env.NODE_ENV === 'production', + version: GG_EDITOR_VERSION, }; export default { diff --git a/tools/webpack.config.base.js b/tools/webpack.config.base.js index 6ae2e8ca..9db6acbc 100644 --- a/tools/webpack.config.base.js +++ b/tools/webpack.config.base.js @@ -1,5 +1,6 @@ const path = require('path'); const webpack = require('webpack'); +const pkg = require('../package.json'); const rules = [{ test: /\.js$/, @@ -33,6 +34,7 @@ const rules = [{ const plugins = [ new webpack.DefinePlugin({ + GG_EDITOR_VERSION: JSON.stringify(pkg.version), 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV), },