React NPM library starter kit
based on Facebook's Create react app.
We are constantly updating repository with the updates of
create-react-app, so we have all new features and bug fixes of it.
Converted to custom setup
Moved all dependencies to dev dependencies because we don't need extra dependencies for our library after build, but we want all this features while developing:
- React, JSX, ES6, and Flow syntax support.
- Language extras beyond ES6 like the object spread operator.
- A dev server that lints for common errors.
- Autoprefixed CSS, so you don’t need
-webkitor other prefixes.
buildscript to bundle JS, CSS, and images for production.
git clone https://github.com/DimiMikadze/create-react-library.git
npm install or
Start development server
npm start or
Runs the demo app in development mode. Open http://localhost:3000 to view it in the browser.
All library files are located inside
Is located inside
src/demo directory, here you can test your library while developing
npm run test or
yarn run test
npm run build or
yarn run build
Produces production version of library under the
Usage of other libraries within your library
- Add the library as a peer dependency in package.json (effectively requiring the calling project to provide this dependency)
- Add the library as a dev dependency in package.json (effectively allowing this library to successfully build without complaining about not having this dependency)
- Add the library to the externals config in your webpack.config file(s). By default, only react and react-dom are there, meaning that those are the only two libraries that you can use within your new shared library.