@meteorjs/rspack
The default Rspack configuration for Meteor applications. This package provides everything you need to bundle your Meteor app with Rspack out of the box: client and server builds, SWC transpilation, React/Blaze/Angular support, hot module replacement, asset management, and all the Meteor-specific wiring so you don't have to.
When Meteor runs with the Rspack bundler enabled, this package is what generates the underlying Rspack configuration. It detects your project setup (TypeScript, React, Blaze, Angular), sets up the right loaders and plugins, defines Meteor.isClient/Meteor.isServer and friends, configures caching, and exposes a set of helpers you can use in your own rspack.config.js to customize the build without breaking Meteor integration.
What it provides
- Dual client/server builds with the correct targets, externals, and output paths
- SWC-based transpilation for JS/TS/JSX/TSX with automatic framework detection
- React Fast Refresh in development when React is enabled
- Blaze template handling via ignore-loader when Blaze is enabled
- Persistent filesystem caching for fast rebuilds
- Asset externals and HTML generation through custom Rspack plugins
- A
defineConfig helper that accepts a factory function receiving Meteor environment flags and build utilities
- Customizable config via
rspack.config.js in your project root, with safe merging that warns if you try to override reserved settings
- Automatic CSS delegation when rspack is configured with CSS, Less, or SCSS loaders, Meteor automatically detects the handled extensions after the first compilation and stops processing those files itself in the entry folder context. No
.meteorignore entries needed.
Installation
Rspack integration is automatically managed by the rspack Atmosphere package.
meteor add rspack
By doing this, your Meteor app will automatically serve @meteorjs/rspack and the required @rspack/cli, @rspack/core, among others.
Usage
In your project's rspack.config.js, use the defineConfig helper to customize the build. The factory function receives a env object with Meteor environment flags and helper utilities:
const { defineConfig } = require('@meteorjs/rspack');
module.exports = defineConfig((env, argv) => {
return {
};
});
More information is available in the official docs: Rspack Bundler Integration.
Development
Install dependencies
npm install
Version bumping
Use npm run bump to update the version in package.json before publishing.
npm run bump -- <major|minor|patch> [--beta]
Standard bumps increment the version and remove any prerelease suffix:
npm run bump -- patch
npm run bump -- minor
npm run bump -- major
Beta bumps append or increment a -beta.N prerelease suffix:
npm run bump -- patch --beta
npm run bump -- patch --beta
npm run bump -- patch --beta
If you change the bump level while on a beta, the base version updates and the beta counter resets:
npm run bump -- minor --beta
npm run bump -- major --beta
Publishing a beta release
After bumping to a beta version, publish to the beta dist-tag:
npm run bump -- patch --beta
npm run publish:beta
Users can then install the beta with:
npm install @meteorjs/rspack@beta
You can pass extra flags to npm publish through the script:
npm run publish:beta -- --dry-run
Publishing an official release
After bumping to a stable version, publish with the default latest tag:
npm run bump -- patch
npm publish
Typical workflows
Beta iteration: ship multiple beta builds for the same upcoming patch:
npm run bump -- patch --beta
npm run publish:beta
npm run bump -- patch --beta
npm run publish:beta
Promote beta to stable: once the beta is ready, bump to the stable version and publish:
npm run bump -- patch
npm publish
Direct stable release: skip the beta phase entirely:
npm run bump -- minor
npm publish