For any project that wants to adopt Rspack, start by addressing the prerequisites needed for this to work in any Meteor app.
Today I’ll mention the first one: clearly defining your Meteor app’s entry points.
Meteor apps with a modular structure can adopt the Rspack integration. Modular here means declaring the entry files that start your client and server apps, along with the tests. Your app should specify at package.json:
{
"meteor": {
"mainModule": {
"client": "client/main.js",
"server": "server/main.js"
},
"testModule": "tests.js"
}
}
Learn more on “Modular application structure” in Meteor.
Before using this modular config with entrypoints (before Meteor 1.7), the Meteor bundler eagerly loaded every JS file it encountered in your project directory and constructed the booter itself. That was less efficient and didn’t match how modern bundlers work. During the Meteor 3.3 beta, some projects that sent me profiles didn’t describe their entrypoints, and I’m not sure they know how.
Describing entrypoints isn’t about creating blank files and listing them in package.json. Those entrypoints must import the rest of your app’s modules in order. An entrypoint is the first module that builds the module tree for your app, so it’s the starting point for booting it. You need to migrate your app to use this approach to use the opt-in Rspack integration.
Please answer the next question so we can understand your app’s state and decide whether to add more automation, documentation or guide to ensure a modular structure with clear entry points.
Do you use entry points in your Meteor app?
- Yes, my project already uses entry points for the app and tests
- No, my project doesn’t use entry points, but I know how to migrate
- No, my project doesn’t use entry points, and I don’t know how to migrate