From 64db3064c76b52dec070e113998415b9b5e65430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 2 May 2018 18:12:24 +0800 Subject: [PATCH] docs(examples): add yarn add webpack-cli step Running node_modules/bin/webpack without webpack-cli installed will get hang. The culprit is that webpack expects a stdin of whether to install webpack-cli or not. However, as examples/build-common use `child_process.exec` to execute `webpack`, the user will not be prompted for any questions since the stdin is not piped and the stdout will be pass to parent process only after the child process exits. We can keep build-common simple by instructing devs to install webpack-cli before they build examples. Also rewrite the install step using yarn since we use yarn in webpack. --- examples/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index 3ab122edd5f..6407710e237 100644 --- a/examples/README.md +++ b/examples/README.md @@ -120,8 +120,9 @@ If you think an example is missing, please report it as issue. :) # Building an Example -1. Run `npm install` in the root of the project. -2. Run `npm link webpack` in the root of the project. -3. Run `node build.js` in the specific example directory. (Ex: `cd examples/commonjs && node build.js`) +1. Run `yarn` in the root of the project. +2. Run `yarn link webpack` in the root of the project. +3. Run `yarn add --dev webpack-cli` in the root of the project. +4. Run `node build.js` in the specific example directory. (Ex: `cd examples/commonjs && node build.js`) Note: To build all examples run `npm run build:examples`