A modern, batteries-included frontend build tool, written in Rust
Component Reborn is a complete rewrite of the original componentjs package manager, reimagined as a modern frontend build tool. Instead of reviving the old Component ecosystem, we've taken inspiration from the original vision of a "vertically integrated frontend solution" and built something new for today's web development needs.
One command: dev server + build + asset pipeline
- π Fast - Written in Rust for maximum performance
- π¦ ES Modules - Native ES module support with TypeScript and JSX/TSX
- π¨ CSS - CSS modules and automatic vendor prefixing
- π₯ HMR - Hot Module Replacement for instant feedback
- π οΈ Zero Config - Sensible defaults, fully configurable when needed
- π Plugins - Extensible plugin system (Vite/Rollup-style)
# Using cargo
cargo install component
# Or build from source
git clone https://github.com/componentjs/component
cd component
cargo build --release# Create a new React project with TypeScript
component init --template react --typescript my-app
# Create a vanilla JavaScript project
component init my-app
# Available templates: vanilla, react, vue, sveltecd my-app
component devOpen http://localhost:3000 to see your app. Changes to your code will automatically trigger hot reloads.
component buildOutputs optimized bundles to the dist/ directory.
Create a component.toml in your project root:
# Component Reborn Configuration
[project]
name = "my-app"
version = "0.1.0"
[entrypoints]
main = "src/main.tsx"
# Multiple entrypoints supported
# admin = "src/admin/main.tsx"
[output]
dir = "dist"
public_url = "/"
hash = true # Add content hash to filenames
manifest = true # Generate asset manifest
[features]
jsx = true
typescript = true
css_modules = true
tree_shaking = true
code_splitting = true
[dev]
port = 3000
host = "localhost"
open = false # Auto-open browser
hmr = true # Hot Module ReplacementInitialize a new project.
component init my-app
component init --template react --typescript my-appOptions:
-t, --template <name>- Project template (vanilla, react, vue, svelte)--typescript- Use TypeScript
Start development server with HMR.
component dev
component dev --port 8080
component dev --openOptions:
-p, --port <port>- Server port (default: 3000)--host <host>- Server host (default: localhost)--open- Open browser automatically--no-hmr- Disable hot module replacement
Build for production.
component build
component build --outdir dist
component build --no-minifyOptions:
-o, --outdir <dir>- Output directory-m, --minify- Enable minification (default: true)--sourcemap- Generate source maps (default: true)--target <target>- Target environment (es2020, es2021, etc.)
my-app/
βββ component.toml # Configuration
βββ package.json # npm compatibility
βββ index.html # HTML template
βββ src/
β βββ main.tsx # Entry point
β βββ App.tsx # Root component
β βββ style.css # Global styles
βββ dist/ # Build output
βββ main.abc123.js
βββ main.abc123.css
βββ manifest.json
- TypeScript/JavaScript bundling
- Single entrypoint
- Basic output bundle
- Project initialization
- Multiple entrypoints
- CSS handling + extraction
- Asset hashing & manifest
- Full SWC integration
- Local HTTP server
- WebSocket HMR infrastructure
- File watching with incremental rebuilds
- Hot module replacement for JS/CSS
- Plugin API (Vite/Rollup-style)
- Framework plugins (React, Vue, Svelte)
- Error overlay
- Great error messages
Contributions are welcome! Please read our Contributing Guide for details.
# Clone the repository
git clone https://github.com/componentjs/component
# Build
cargo build
# Run tests
cargo test
# Run with example
cd examples/react-app
../../target/debug/component devMIT Β© Component Contributors
This project is a spiritual successor to the original componentjs/component, which was a pioneering frontend package manager created by TJ Holowaychuk. While the original project is archived and deprecated, Component Reborn carries forward its vision of a batteries-included frontend solution for a new generation of web development.
The original project's approach of handling "everything from package management to the build process, handling everything including HTML, JS, CSS, images, and fonts" inspired this modern rewrite. We've updated the technology stack and approach to match today's frontend development needs while maintaining the original spirit of simplicity and integration.
