Latest Results
feat(core): add compilation.runtimeTemplate
Align with webpack by exposing a `RuntimeTemplate` on `Compilation`, so plugins
can generate runtime code that matches `output.environment` instead of
hand-rolling the arrow-function/destructuring/for-of/template-literal branches.
The environment dependent branches mirror `RuntimeTemplate` in
crates/rspack_core/src/runtime_template.rs.
The webpack methods that render references to other modules (`moduleId`,
`moduleRaw`, `moduleExports`, `moduleNamespace`, `moduleNamespacePromise`,
`importStatement`, `exportFromImport`, `blockPromise`, `asyncModuleFactory`,
`syncModuleFactory`, `weakError`, `runtimeConditionExpression`) are left out,
because Rspack keeps the module graph and the code generation results on the
Rust side. `comment()` needs a `compilation.requestShortener`, which Rspack does
not have, and `defineEsModuleFlagStatement()` needs runtime globals rendered as
webpack strings, while Rspack resolves them from a numeric enum depending on the
runtime mode.
Closes #10014kakiuwang-ui:feat/compilation-runtime-template Latest Branches
0%
+37%
seal/optimize-bundle-splitting 0%
kakiuwang-ui:feat/compilation-runtime-template © 2026 CodSpeed Technology