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.
Quick Overview
npx @udilia/create-react-library my-lib
cd my-lib
npm start
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.
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.
请发表评论