Skip to content

Yeoman generator for creating React applications

License

Notifications You must be signed in to change notification settings

Kaschman/app-generators

Repository files navigation

generator-react-app

Yeoman generator for creating React applications

Getting started:

Running the React Generator

  1. $ yarn global add yo if you haven't installed Yeoman yet.
  2. $ yarn install
  3. $ yarn build
  4. $ yarn link from this project's root directory to make the generator discoverable by Yeoman
  5. $ yo kaschman to run the generator - note: the generator does not work if you have uncommitted git files in the directory where the command is run.

Running the API Generator

  1. $ yarn global add yo if you haven't installed Yeoman yet.
  2. $ yarn install
  3. $ yarn build
  4. $ yarn link from this project's root directory to make the generator discoverable by Yeoman
  5. $ yo kaschman:api to run the generator - note: the generator does not work if you have uncommitted git files in the directory where the command is run.

React Generator Development

Create React App takes awhile to run. When developing the generator, you can use a cached version of the Create React App boilerplate to speed up generation time.

  1. $ yarn global add yo if you haven't installed Yeoman yet.
  2. $ yarn install
  3. $ yarn build
  4. $ yarn link from this project's root directory to make the generator discoverable by Yeoman
  5. $ yarn update:cra-cache to load the CRA cache. Run again to update it if needed. Note: you cannot have uncommitted git files to run this script.
  6. $ yarn generate to run the generator with the CRA cache targeting the /sample-react-app directory

Some notes on working with Yeoman in ES6.

Performance

Even using the --cra-cache flag can be a bit slow. The project uses recursive-copy. fs-extra had perforance issues. cpy, while more performant that recurive-copy, does not support recursion.

Babel Config

babel-plugin-add-module-exports is needed for the old module.exports functionality (see this issue).

About

Yeoman generator for creating React applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published