Skip to content

Commit

Permalink
docs(examples): add yarn add webpack-cli step
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JLHwung committed May 2, 2018
1 parent 7543c45 commit 64db306
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/README.md
Expand Up @@ -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`

0 comments on commit 64db306

Please sign in to comment.