npm-packages/meteor-rspack/README.md
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.
defineConfig helper that accepts a factory function receiving Meteor environment flags and build utilitiesrspack.config.js in your project root, with safe merging that warns if you try to override reserved settingsRspack 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.
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) => {
// env.isClient, env.isServer, env.isDevelopment, env.isProduction
// env.isReactEnabled, env.isBlazeEnabled, etc.
return {
// Your custom Rspack configuration here.
// It gets safely merged with the Meteor defaults.
};
});
More information is available in the official docs: Rspack Bundler Integration.
npm install
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 # 1.0.1 -> 1.0.2
npm run bump -- minor # 1.0.1 -> 1.1.0
npm run bump -- major # 1.0.1 -> 2.0.0
Beta bumps append or increment a -beta.N prerelease suffix:
npm run bump -- patch --beta # 1.0.1 -> 1.0.2-beta.0
npm run bump -- patch --beta # 1.0.2-beta.0 -> 1.0.2-beta.1
npm run bump -- patch --beta # 1.0.2-beta.1 -> 1.0.2-beta.2
If you change the bump level while on a beta, the base version updates and the beta counter resets:
npm run bump -- minor --beta # 1.0.2-beta.2 -> 1.1.0-beta.0
npm run bump -- major --beta # 1.1.0-beta.0 -> 2.0.0-beta.0
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
After bumping to a stable version, publish with the default latest tag:
npm run bump -- patch
npm publish
Beta iteration: ship multiple beta builds for the same upcoming patch:
npm run bump -- patch --beta # 1.0.1 -> 1.0.2-beta.0
npm run publish:beta
# ... fix issues ...
npm run bump -- patch --beta # 1.0.2-beta.0 -> 1.0.2-beta.1
npm run publish:beta
Promote beta to stable: once the beta is ready, bump to the stable version and publish:
npm run bump -- patch # 1.0.2-beta.1 -> 1.0.3
npm publish
Direct stable release: skip the beta phase entirely:
npm run bump -- minor # 1.0.1 -> 1.1.0
npm publish