Codebase
Meteor's build system (Isobuild) and CLI structure.
Overview
Meteor is a full-stack JavaScript platform with:
- Core packages in
/packages
- Build system (Isobuild) in
/tools/isobuild
- CLI tool in
/tools/cli
- Real-time data layer via DDP
- Mobile support via Cordova
Build Pipeline
- CLI (
tools/cli/main.js) → parses commands
- Project Context (
project-context.js) → resolves packages, dependencies
- Isobuild (
tools/isobuild/)
- Bundler (
bundler.js) → orchestrates build
- Compiler (
compiler.js) → compiles packages
- Linker (
linker.js) → wraps modules
- Build plugins (Babel, TypeScript, CSS)
- Output →
star.json, programs
- Runners (
tools/runners/) → run-app.js, run-mongo.js, run-hmr.js
- Live App → DDP Server ↔ Minimongo ↔ UI
Directory Structure
tools/
├── cli/ # Command-line interface
├── isobuild/ # Build system core
├── packaging/ # Package management
├── runners/ # App execution engines
├── fs/ # File system utilities
├── cordova/ # Mobile/Cordova support
├── static-assets/ # Project templates
└── project-context.js # Dependency resolution
CLI (tools/cli/)
| File |
Description |
main.js |
Entry point, command dispatcher |
commands.js |
Main command implementations |
commands-packages.js |
Package management commands |
commands-cordova.js |
Cordova/mobile commands |
Commands: meteor create, run, build, deploy, add/remove, mongo, shell
Isobuild (tools/isobuild/)
| File |
Description |
bundler.js |
High-level bundling orchestration |
compiler.js |
Package compilation |
linker.js |
Module wrapping and linking |
import-scanner.ts |
Import statement parsing |
compiler-plugin.js |
Compiler plugin API |
isopack.js |
Package format handling |
Runners (tools/runners/)
| File |
Description |
run-app.js |
Web application runner |
run-mongo.js |
MongoDB server runner |
run-hmr.js |
Hot module reload runner |
run-all.js |
Multi-runner orchestration |
Build Targets
| Target |
Description |
web.browser |
Modern browsers |
web.browser.legacy |
Legacy browsers (IE11) |
web.cordova |
Cordova mobile apps |
server |
Node.js server |
Package Relationships
tools-core → rspack, future integrations
accounts-base → all accounts-* packages
ddp-server + ddp-client → realtime communication
mongo → minimongo (client-side)
webapp → all HTTP handling
Project Templates
Via meteor create --<template>: react, vue, svelte, angular, blaze, typescript, tailwind, solid, apollo, minimal, bare, full
Environment Variables
| Variable |
Purpose |
METEOR_PROFILE |
Build profiling |
METEOR_PACKAGE_DIRS |
Additional package paths |
METEOR_DEBUG_BUILD |
Verbose build output |
Troubleshooting
- Package not found: Check
package.js name, run meteor reset
- Build plugin not running: Check
archMatching, file extensions
- npm issues: Clear
.meteor/local/, run meteor npm install
1---2name: codebase3description: Use when understanding the build system, modifying CLI commands, working with isobuild, or navigating the tools/ directory. Covers build pipeline flow and file locations.4---56# Codebase78Meteor's build system (Isobuild) and CLI structure.910## Overview1112Meteor is a full-stack JavaScript platform with:13- **Core packages** in `/packages`14- **Build system (Isobuild)** in `/tools/isobuild`15- **CLI tool** in `/tools/cli`16- **Real-time data layer** via DDP17- **Mobile support** via Cordova1819## Build Pipeline20211. **CLI** (`tools/cli/main.js`) → parses commands222. **Project Context** (`project-context.js`) → resolves packages, dependencies233. **Isobuild** (`tools/isobuild/`)24 - Bundler (`bundler.js`) → orchestrates build25 - Compiler (`compiler.js`) → compiles packages26 - Linker (`linker.js`) → wraps modules27 - Build plugins (Babel, TypeScript, CSS)284. **Output** → `star.json`, programs295. **Runners** (`tools/runners/`) → run-app.js, run-mongo.js, run-hmr.js306. **Live App** → DDP Server ↔ Minimongo ↔ UI3132## Directory Structure3334```35tools/36├── cli/ # Command-line interface37├── isobuild/ # Build system core38├── packaging/ # Package management39├── runners/ # App execution engines40├── fs/ # File system utilities41├── cordova/ # Mobile/Cordova support42├── static-assets/ # Project templates43└── project-context.js # Dependency resolution44```4546## CLI (`tools/cli/`)4748| File | Description |49|------|-------------|50| `main.js` | Entry point, command dispatcher |51| `commands.js` | Main command implementations |52| `commands-packages.js` | Package management commands |53| `commands-cordova.js` | Cordova/mobile commands |5455**Commands:** `meteor create`, `run`, `build`, `deploy`, `add/remove`, `mongo`, `shell`5657## Isobuild (`tools/isobuild/`)5859| File | Description |60|------|-------------|61| `bundler.js` | High-level bundling orchestration |62| `compiler.js` | Package compilation |63| `linker.js` | Module wrapping and linking |64| `import-scanner.ts` | Import statement parsing |65| `compiler-plugin.js` | Compiler plugin API |66| `isopack.js` | Package format handling |6768## Runners (`tools/runners/`)6970| File | Description |71|------|-------------|72| `run-app.js` | Web application runner |73| `run-mongo.js` | MongoDB server runner |74| `run-hmr.js` | Hot module reload runner |75| `run-all.js` | Multi-runner orchestration |7677## Build Targets7879| Target | Description |80|--------|-------------|81| `web.browser` | Modern browsers |82| `web.browser.legacy` | Legacy browsers (IE11) |83| `web.cordova` | Cordova mobile apps |84| `server` | Node.js server |8586## Package Relationships8788- `tools-core` → rspack, future integrations89- `accounts-base` → all accounts-* packages90- `ddp-server` + `ddp-client` → realtime communication91- `mongo` → minimongo (client-side)92- `webapp` → all HTTP handling9394## Project Templates9596Via `meteor create --<template>`: `react`, `vue`, `svelte`, `angular`, `blaze`, `typescript`, `tailwind`, `solid`, `apollo`, `minimal`, `bare`, `full`9798## Environment Variables99100| Variable | Purpose |101|----------|---------|102| `METEOR_PROFILE` | Build profiling |103| `METEOR_PACKAGE_DIRS` | Additional package paths |104| `METEOR_DEBUG_BUILD` | Verbose build output |105106## Troubleshooting107108- **Package not found:** Check `package.js` name, run `meteor reset`109- **Build plugin not running:** Check `archMatching`, file extensions110- **npm issues:** Clear `.meteor/local/`, run `meteor npm install`