LoginSignup
2

More than 5 years have passed since last update.

Node v6.0.0-preでReactをビルドする

Last updated at Posted at 2015-12-10

npm installするとfbjs内部スクリプトでNodeのバージョンが 4.x or 5.x というバリデーションが入っているのでそのままだと失敗する。
この条件は実際にはReactリポジトリのpackage.jsonのdevEngines.nodeを見ている。

ビルドするためにはReactのpostinstallを殺しておけばいい。

diff --git a/package.json b/package.json
index 0fd7f94..389e7c1 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,6 @@
     "build": "grunt build",
     "linc": "git diff --name-only --diff-filter=ACMRTUB `git merge-base HEAD master` | grep '\\.js$' | xargs eslint --",
     "lint": "grunt lint",
-    "postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json",
     "test": "jest"
   },
   "jest": {

npm run build すると build/ 以下に成果物のファイルが吐かれる。

ls build/
modules                  react-dom-server.js      react-dom.js             react-with-addons.js     react.js
packages                 react-dom-server.min.js  react-dom.min.js         react-with-addons.min.js react.min.js

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2