Skip to content

Commit

Permalink
feat: Record the version of the project
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoli committed Dec 14, 2018
1 parent 03d56e7 commit 8de4469
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/Global.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* global GG_EDITOR_VERSION */

const global = {
trackable: process.env.NODE_ENV === 'production',
version: GG_EDITOR_VERSION,
};

export default {
Expand Down
2 changes: 2 additions & 0 deletions tools/webpack.config.base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const webpack = require('webpack');
const pkg = require('../package.json');

const rules = [{
test: /\.js$/,
Expand Down Expand Up @@ -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),
},
Expand Down

0 comments on commit 8de4469

Please sign in to comment.