TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/meteor/meteor/llms.txt
Use this file to discover all available pages before exploring further.
rspack package integrates the Rspack bundler into Meteor’s build system, providing a modern, fast bundling solution for Meteor applications with support for React, Angular, TypeScript, and more.
Overview
Rspack is a high-performance JavaScript bundler that runs independently within the Meteor lifecycle. It supports development mode with hot module replacement (HMR) and production builds with optimization.Installation
The package automatically installs required dependencies when enabled. Manual installation:Configuration
Entry Points
Rspack requires entry points defined inpackage.json:
meteor.mainModule.client- Client-side entry pointmeteor.mainModule.server- Server-side entry point
meteor.testModule.client- Client test entrymeteor.testModule.server- Server test entrymeteor.testModule- Single test file for both client and server
Rspack Configuration File
Createrspack.config.js in your project root. The package provides a default configuration that will be created automatically if missing.
Basic example:
Meteor Configuration
Configure Rspack behavior inpackage.json:
autoInstallDeps- Automatically install Rspack dependencies (default:true)devServerPort- Dev server port (default: calculated automatically)verbose- Enable verbose loggingbundleVisualizer.enabled- Enable bundle analysis with RsdoctorbundleVisualizer.clientPort- Rsdoctor client portbundleVisualizer.serverPort- Rsdoctor server port
Build Modes
Development Mode
Run withmeteor run or meteor:
- Hot Module Replacement (HMR)
- Fast rebuilds with watch mode
- Source maps enabled
- Dev server for client assets
- File watching for server code
Production Mode
Run withmeteor run --production or meteor build:
- Minified bundles
- Optimized code
- No dev server
- Watch mode in
run --production - Single build in
meteor build
Test Mode
Run tests with Rspack:- Unit tests (
meteor test) - Full-app tests (
meteor test --full-app) - Watch mode for continuous testing
Plugin Architecture
Main Entry Point
The plugin orchestrates the Rspack integration:Build Context
Rspack uses a.rspack directory for build artifacts:
File Ignoring
The package automatically configures.meteorignore patterns:
node_modules/**- Non-entrypoint directories
- Build context folders
- CSS/HTML files in entry point directories (handled by Rspack)
Framework Support
React
Automatically detected and configured:reactreact-dom@rspack/plugin-react-refresh(auto-installed)
TypeScript
Automatic TypeScript support when detected:.ts- TypeScript.tsx- TypeScript with JSX
Angular
Angular support detection:Dev Server
Port Configuration
Ports are automatically calculated or configured:Proxy Middleware
Client assets are served through a proxy:Bundle Visualization
Enable Rsdoctor for bundle analysis:- Client:
http://localhost:3200 - Server:
http://localhost:3201
Compilation Tracking
The package tracks first compilation to ensure Meteor waits:Environment Variables
RSPACK_DEVSERVER_PORT- Dev server portRSDOCTOR_CLIENT_PORT- Rsdoctor client portRSDOCTOR_SERVER_PORT- Rsdoctor server portYARN_ENABLED- Whether project uses YarnMETEOR_DISABLE_COLORS- Disable colored output
Debugging
Enable verbose logging:package.json:
- Rspack configuration paths
- Dev server ports
- Rsdoctor ports
- NPM/Yarn prefixes
- Entry points
- Ignore patterns
Cleanup
Automatic cleanup on exit:Limitations
- Requires explicit entry points in
package.json - Client and server must have separate entry files
.meteorignoreis automatically modified- Legacy browser support requires additional configuration
- Native mobile builds use production mode