Create React NPM Library with no build configuration, based on Facebook's Create React App. We are constantly updating the repository with the updates of create-react-app, so we have all new features and bug fixes of it.
npx @udilia/create-react-library my-lib
cd my-lib
npm start
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
Then open http://localhost:3000 to see demo library running in the browser.
You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine.
To create a new library, you may choose one of the following methods:
npx @udilia/create-react-library my-lib
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
npm init @udilia/react-library my-lib
npm init <initializer>
is available in npm 6+
yarn create @udilia/react-library my-lib
yarn create
is available in Yarn 0.25+
It will create a directory called my-lib
inside the current folder.
Inside that directory, it will generate the initial project structure and install dependencies.
my-lib
├── config
├── node_modules
├── public
├── scripts
├── src
├── demo
├── lib
├── .gitignore
├── package.json
├── README.md
All library files are located inside src/lib folder.
Inside src/demo folder, you can test your library while developing.
Once the installation is done, you can open your project folder:
cd my-lib
Inside the newly created project, you can run some built-in commands:
Runs the library in development mode. Open http://localhost:3000 to view it in the browser.
Runs the test watcher in an interactive mode.
Builds the library for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
Publishes the library to NPM.
Please read our CONTRIBUTING.md before submitting a Pull Request to the project.
- 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.
https://github.com/DimiMikadze/react-under-construction
MIT License Copyright (c) 2019 Dimi Mikadze