Add React.version

getConfig needs to be a function because grunt.config.data.pkg.version isn't available at the time that grunt/config/jsx/jsx.js is required.

Test Plan:
grunt build, grunt lint, grunt test all work. After building, both react.js and react.min.js contain the version number.
This commit is contained in:
Ben Alpert
2013-09-09 17:01:06 -07:00
parent 888cc309e0
commit 5fd4467bf7
7 changed files with 44 additions and 24 deletions
+1
View File
@@ -19,6 +19,7 @@
"unused": "vars",
"globals": {
"__VERSION__": false,
"__DEV__": false,
"require": false,
"module": false,
+4
View File
@@ -50,4 +50,8 @@ var React = {
isValidComponent: ReactComponent.isValidComponent
};
// Version exists only in the open-source version of React, not in Facebook's
// internal version.
React.version = __VERSION__;
module.exports = React;