Loading...
Loading...
Use when migrating an existing Meteor 3 app to the Rspack bundler integration (`rspack` Atmosphere package, Meteor 3.4+). Triggers on removing nested imports, defining mainModule entry points, server-only apps, replacing fourseven:scss / meteor/less / coffeescript / jorgenvatle:vite / zodern:melte build plugins with Rspack loaders, "Error: 'import' and 'export' cannot be used outside of module code", CommonJS default-import interop, _build / build-assets / build-chunks folders, module.exports in a client graph, Node built-ins in browser code, .meteorignore hiding mainModule handoff files, dynamic chunks under ROOT_URL, meteor.modules for CSS or HTML, resolve.symlinks in a monorepo, resolve.alias migration, meteor update --npm in CI/Docker. Use this skill when the user asks about converting an app to Rspack, asks about a build plugin's Rspack replacement, or asks about CI/Docker errors after upgrading. For setup and rspack.config.js helpers, use meteor-modern-build-stack instead.
npx skill4agent add meteor/agent-skills migrate-to-rspack"meteor": { "modern": true }meteor-modern-build-stackrspack.config.js@meteorjs/rspack@rspack/core@rspack/cli| Meteor | | | Capability boundary |
|---|---|---|---|
| 3.4 | | | Base integration and helpers. |
| 3.4.1 and 3.5 | | | Adds v2 helpers and inherited |
| 3.5.1 | | | Revised client polyfills and extension discovery. |
.meteor/versionspackage.jsonmeteor update --npmpackage.jsonmeteor.mainModulereferences/client-graph-preflight.mdimportifimport()requirelessfourseven:scsscoffeescriptzodern:meltejorgenvatle:vitereferences/framework-and-css.mdimport x from "some-cjs"import * as x.swcrcreferences/code-migrations.mdmainModule.servermeteor.modulesresolve.symlinks: falsemeteor add rspack[Transpiler](app){
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"testModule": "tests.js"
}
}mainModulereferences/framework-and-css.md// app code: NOT allowed under Rspack
if (condition) {
import { a as b } from "./c";
console.log(b);
}// 1. Move to top
import { a as b } from "./c";
if (condition) console.log(b);
// 2. Dynamic import (standardized, supported)
if (condition) {
const { a: b } = await import("./c");
console.log(b);
}
// 3. require (CommonJS interop)
if (condition) {
const { a: b } = require("./c");
console.log(b);
}(app)Error: 'import' and 'export' cannot be used outside of module code(package)_build/public/build-assets/public/build-chunks/private/build-assets/.gitignorepackage.json{
"meteor": {
"buildContext": "build",
"assetsContext": "assets",
"chunksContext": "chunks"
}
}.gitignore.meteorignoreMETEOR_IGNOREreferences/framework-and-css.md| Old plugin | Replacement |
|---|---|
| |
| |
| |
| Official Rspack Svelte loader. |
| Native Rspack Vue/Solid loaders. |
| Babel via Rspack loader on |
| Still compatible. Keep it. |
import x from "some-cjs-lib"module.exports = ...// preferred: switch to namespace import
import * as x from "some-cjs-lib";.swcrc{
"module": {
"type": "commonjs",
"noInterop": false,
"importInterop": "node"
}
}Could not find rspack.config.js, rspack.config.ts, rspack.config.mjs, or rspack.config.cjsmeteor update --npmpackage.jsonmeteor npm cimeteor buildreferences/troubleshooting.md"meteor": { "modern": { "transpiler": { "verbose": true } } }.swcrc_build/public/build-assets/public/build-chunks/private/build-assets/meteor update --npmreferences/code-migrations.mdreferences/client-graph-preflight.mdreferences/validation-matrix.mdreferences/framework-and-css.mdreferences/troubleshooting.mdreferences/eval-cases.mdrspack.config.jsmeteor-modern-build-stack