npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-mpx

v0.1.2

Published

Run and export multiple React projects from a single codebase

Readme

react-mpx

react-mpx is a CLI tool that enables you to run and build multiple React projects from a single codebase. The shortcut "mpx" stands for multiplexer or MUX—a device that selects between several input signals and forwards the selected input to a single output line. Similarly, react-mpx dynamically selects and serves one project at a time from a shared set of source files.

Motivation

In many organizations, teams maintain multiple frontend applications that share common components, utilities, and infrastructure. Instead of duplicating this shared logic across repositories, react-mpx lets you colocate multiple projects in one codebase while ensuring they remain independent at build and deployment time.

Important: react-mpx is not a DevOps or multi-project deployment solution. It is designed to reduce redundancy during development by sharing code (components, hooks, styles, etc.) across projects. Each project should be treated as a standalone application and deployed from its own repository or pipeline. If you modify only one project, only that project should be rebuilt and redeployed—others must not be affected. This tool intentionally builds to a single dist/ directory to reinforce that only one project is active per build.

Future versions may support building multiple projects in one pass, but this will remain optional and opt-in.

Features

  • Zero-configuration entry point: no main.tsx required
  • Automatic project discovery from src/projects/
  • Shared code (components, utils, styles, i18n, etc.) across projects
  • Isolated builds: each run targets exactly one project
  • Full TypeScript support
  • Vite 7+ compatible
  • Preserves your index.html (no overrides)
  • Validates setup before running

Requirements

  • Node.js >= 20.19.0
  • A index.html file in your project root containing a <div id="root"></div>
  • Project components in src/projects/ (e.g., src/projects/app-a.tsx)

Installation

Globally (recommended for faster take-off):

npm install -g react-mpx

Or

npx react-mpx

Usage

List available projects interactively:

react-mpx dev
react-mpx build

Or specify a project directly:

react-mpx dev --project app-a
react-mpx build --project admin-panel

Custom projects directory

By default, projects are loaded from src/projects/. You can override this:

react-mpx dev --project my-app --src ./apps

Accessing the Active Project in Code

The currently selected project name is available in your application code via Vite’s built-in environment variable:

const currentProject = import.meta.env.MODE;

This value matches the --project name you passed to the CLI (e.g., "app-a").

Project Structure Example

my-monorepo/
├── index.html
├── src/
│   ├── components/        ← shared components
│   ├── hooks/             ← shared hooks
│   ├── styles/            ← shared styles
│   ├── i18n.ts            ← shared i18n setup
│   └── projects/
│       ├── app-a.tsx      ← project A entry
│       └── app-b.tsx      ← project B entry
└── package.json

Each project file (e.g., app-a.tsx) must export a default React component.