Can Meteor–Rspack load compiled Blaze HTML with an async route chunk?
We use Meteor 3.5.2, [email protected], @meteorjs/[email protected], and Blaze on Linux. A route dynamically imports its controller, which imports its paired HTML:
// Route
waitOn() {
return import('/imports/ui/pages/tagged-with-page.js');
}
// tagged-with-page.js
import './tagged-with-page.html';The controller is loaded on demand, but the compiled template is in Meteor’s initial app/app.js. On an unrelated /login visit, Template.tagged_with_page is already registered.
In the installed integration, Rspack ignores .html and RequireExternalsPlugin eagerly links HTML imports into Meteor’s startup entry. It appears that Rspack’s import()/splitChunks therefore cannot split the compiled templates.
- Is there a supported way today to load the compiled Blaze template when the route’s controller is imported?
- Does meteor.modules only select files for Meteor compilation, rather than make those templates lazy?
- If this is not supported, would route-lazy compiled Blaze HTML fit the Meteor–Rspack roadmap? What integration point would be appropriate?
This is a question/feature request, not a bug report: I don’t have a last-known-working Meteor version or a public minimal reproduction. I found the earlier Blaze template code-splitting discussion (https://github.com/meteor/blaze/issues/100), but this question concerns the current Meteor–Rspack build boundary.
Source: meteor/meteor