This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
cralib with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
CLI for creating reusable, modern React libraries using Rollup and create-react-app.
This package requires
node >= 4, but we recommend
node >= 8.
npm install -g cralib
Answer some basic prompts about your module, and then the CLI will perform the following steps:
At this point, your new module should resemble this screenshot and is all setup for local development.
Now, anytime you make a change to your library in
packages/library/src/ or to the example app's
create-react-app will live-reload your local dev server so you can iterate on your component in real-time.
es versions of your module to
dist/ and then publishes your module to
Make sure that any npm modules you want as peer dependencies are properly marked as
package.json. The rollup config will automatically recognize them as peers and not try to bundle them in your module.
npm run deploy
This creates a production build of the example
create-react-app that showcases your library and then runs
gh-pages to deploy the resulting bundle.
MIT © GroverTB