@razorrisk/react-runtime-component-builder
v1.0.9
Published
CLI tool to bundle React components into a runtime‐pluggable library using Vite
Downloads
20
Readme
@razor-webui/react-runtime-component-builder
CLI tool to bundle React components into a runtime-pluggable library using Vite
Features
- Automatic discovery of component entry files (
*.tsx/*.jsx) in a folder - Vite-powered library build for each component
- Outputs an ES module per component for runtime loading
- Configurable via CLI arguments
Installation
Install globally to use the CLI anywhere:
npm install --location=global @razorrisk/react-runtime-component-builderOr use via npx without installing:
npx @razorrisk/react-runtime-component-builder <components-folder> <output-folder>Usage
react-runtime-component-builder componentsRootFolder outputFolderwhere componentsRootFolder is the path to your components directory (e.g. ./src/components) and outputFolder is the path to where you want to place the build components (e.g. ./dist/externals)
Example
Assuming you have:
my-app/
└── src/
└── components/
├── Button.tsx
└── Modal.jsxRun:
npx @razorrisk/react-runtime-component-builder ./src/components ./dist/externalsOutput will be placed in ./externals-dist (by default), containing:
externals-dist/
├── Button.js
└── Modal.js
