Skip to content

perf(runtime): combine co-located ESM export initialization#14801

Open
LingyuCoder wants to merge 11 commits into
mainfrom
seal/define-esm-exports
Open

perf(runtime): combine co-located ESM export initialization#14801
LingyuCoder wants to merge 11 commits into
mainfrom
seal/define-esm-exports

Conversation

@LingyuCoder

@LingyuCoder LingyuCoder commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a DEFINE_ESM_EXPORTS runtime module exposed as __webpack_require__.D / __rspack_context.D
  • compose the existing namespace marker and export getter helpers without changing either helper
  • emit the combined call only when the two operations were already co-located
  • keep non-circular modules with split start/end initialization unchanged
  • reuse existing runtime, tree-shaking, HMR, source-map, and stats tests for coverage

Motivation

ESM modules commonly emit adjacent namespace-marking and export-definition calls. Wrapping those operations reduces generated module call statements while preserving call order and initialization timing.

Behavior

  • circular or unknown ESM initialization that is already emitted together uses .D
  • proven non-circular modules keep the namespace marker at module start and export getters at module end
  • concatenated modules only combine adjacent marker/getter pairs
  • namespace-only paths continue to use the existing marker helper

Validation

  • pnpm run build:binding:dev
  • cargo fmt --all --check
  • git diff --check origin/main...HEAD
  • pnpm run test -t runtime-mode-module-rendering
  • pnpm run test -t cjs-tree-shaking-basic
  • pnpm run test -t webpack-reexport-namespace-and-default
  • pnpm run test -t runtime/circular
  • pnpm run test -t statsAPICases/exports
  • pnpm run test:unit (all relevant tests passed; the two existing parsing/dead-code-elimination variants still fail because their emitted test.js is missing)

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 0f00ff7 to fix: preserve createRequire().resolve with literal import.meta.url when requireResolve is disabled (#14783) by Fy

❌ Size increased by 28.00KB from 66.58MB to 66.61MB (⬆️0.04%)

@LingyuCoder LingyuCoder marked this pull request as ready for review July 15, 2026 16:42
Copilot AI review requested due to automatic review settings July 15, 2026 16:42
@codspeed-hq

codspeed-hq Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing seal/define-esm-exports (0f00ff7) with main (b8e3594)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new combined runtime helper for ESM export initialization so that when the namespace marker and export getter definitions are already emitted adjacent to each other (notably in circular/unknown ESM init paths and certain concatenation scenarios), they can be emitted as a single call (__webpack_require__.esm(...)) to reduce generated statements while preserving ordering/semantics.

Changes:

  • Add RuntimeGlobals::DEFINE_ESM_EXPORTS and a corresponding runtime module/template, exposed as __webpack_require__.esm / __rspack_context.esm.
  • Update ESM init-fragment rendering/merging so co-located namespace marker + export getter initialization can be combined into .esm(...) when appropriate (while keeping proven non-circular split start/end initialization unchanged).
  • Update concatenated-module namespace/export emission and refresh extensive runtime/tree-shaking/HMR/stats/source-map snapshots and assertions accordingly.

Reviewed changes

Copilot reviewed 145 out of 145 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/rspack-test/treeShakingCases/webpack-reexport-namespace-and-default/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...) for combined ESM init.
tests/rspack-test/treeShakingCases/webpack-innergraph-no-side-effects/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/webpack-inner-graph-switch/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/tree-shaking-lazy-import/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/tree-shaking-interop/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/transitive-bailout/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/import-star-as-and-export/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/export-star-chain/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/export-named-decl-as/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/export-imported-import-all-as/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/export_star/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/context-module/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/treeShakingCases/cjs-tree-shaking-basic/snapshots/treeshaking.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/statsOutputCases/simple-export/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsOutputCases/side-effects-issue-7428/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsOutputCases/runtime-specific-used-exports/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsOutputCases/runtime-modules/snapshots/stats.txt Stats snapshot updated to include webpack/runtime/define_esm_exports.
tests/rspack-test/statsOutputCases/match-resource-data-url/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsOutputCases/filename/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsOutputCases/dynamic-import/snapshots/stats.txt Stats snapshot updated for increased runtime module count.
tests/rspack-test/statsAPICases/nested-modules.js Inline snapshot updated for new asset/runtime sizes and module counts.
tests/rspack-test/statsAPICases/exports.js Inline snapshot updated (hash/size/runtime modules) and includes new runtime module entry.
tests/rspack-test/statsAPICases/build-time-executed-runtime.js Expectation updated to account for the additional runtime module.
tests/rspack-test/hotCases/worker/update-in-worker/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/update-in-worker/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/update-in-worker/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/7.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/6.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/5.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/4.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/move-between-runtime/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/7.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/6.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/5.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/4.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/worker/issue-5597/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/unexpected-invalidation/used-exports/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/status/check/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/stats/chunks/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/enable/snapshots/web/3.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/enable/snapshots/web/2.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/enable/snapshots/web/1.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/disable/snapshots/web/3.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/disable/snapshots/web/2.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/source-map/disable/snapshots/web/1.snap.txt HMR/source-map snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/sharing/share-plugin/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/require-disposed-module-warning/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/replace-runtime-module/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/import-after-download/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/hmr-circular/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/dispose-removed-module/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/dispose-removed-module/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/dispose-removed-chunk/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/dispose-removed-chunk/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/dispose-removed-chunk/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/runtime/circular/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/recover/recover-after-self-error/snapshots/web/3.snap.txt Recover snapshot updated; includes emitted define_esm_exports runtime module.
tests/rspack-test/hotCases/recover/recover-after-self-error/snapshots/web/1.snap.txt Recover snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/recover/recover-after-removal-self-accepted/snapshots/web/2.snap.txt Recover snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/recover/recover-after-removal-self-accepted/snapshots/web/1.snap.txt Recover snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/recover/recover-after-parsing-error/snapshots/web/2.snap.txt Recover snapshot updated; includes emitted define_esm_exports runtime module.
tests/rspack-test/hotCases/recover/recover-after-loader-error/snapshots/web/2.snap.txt Recover snapshot updated; includes emitted define_esm_exports runtime module.
tests/rspack-test/hotCases/recover/recover-after-error/snapshots/web/2.snap.txt Recover snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/recover/recover-after-error/snapshots/web/1.snap.txt Recover snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/plugins/html/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/parsing/hot-api-optional-chaining/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/numeric-ids/add-remove-chunks/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/numeric-ids/add-remove-chunks/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/newTreeshaking/re-export-optimization/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/newTreeshaking/auto-reexport/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/module/build-info/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/rebuild-abnormal-module/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/issue-10915/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/fix-issuer/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/clean-isolated-module/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/clean-isolated-cycle/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/clean-isolated-cycle/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/make/clean-isolated-cycle/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/loader/import-module-1/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/lazy-compilation/unrelated/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/lazy-compilation/unrelated/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/lazy-compilation/context/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/lazy-compilation/context/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/hashing/full-hash-main/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/hashing/exports-info-influence/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/hash/hot-index/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/hash/hot-index/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/hash/hot-index/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/harmony/cjs-analyze-changed/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/harmony/auto-reexport/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/harmony/auto-import/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/harmony/auto-import-multiple/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/esm-dependency-import/module-hot/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/esm-dependency-import/import-meta-webpack-hot/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/unaccepted/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/unaccepted-ignored/snapshots/web/3.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/unaccepted-ignored/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/unaccepted-ignored/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/self-decline/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/events/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/decline/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/errors/decline-webpackhot/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/disposing/runtime-independent-filename/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/disposing/remove-chunk-with-shared/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/disposing/remove-chunk-with-shared-in-other-runtime/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/determinism/issue-10174/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/define/issue-6962/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/css/recovery/snapshots/web/2.snap.txt CSS HMR snapshot updated; includes emitted define_esm_exports runtime module.
tests/rspack-test/hotCases/css/css-extract/snapshots/web/1.snap.txt CSS HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/context/request-position/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/conditional-runtime/accept-conditional/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/code-generation/this-in-accept/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/code-generation/this-in-accept-webpackhot/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunks/update-chunk-loading-runtime/snapshots/web/2.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunks/update-chunk-loading-runtime/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunks/system-import/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunks/dynamic-system-import/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunk/ensure-chunk-change-to-promise-all/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunk/accept-system-import/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/chunk/accept-system-import-webpackhot/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/child-compiler/issue-9706/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/hotCases/asset/parser-and-generator-states/snapshots/web/1.snap.txt HMR snapshot updated for .esm(...) and size changes.
tests/rspack-test/configCases/runtime/runtime-mode-module-rendering/test.config.js Assertion updates to ensure non-circular runtime-mode module rendering does not use .esm.
tests/rspack-test/configCases/runtime/runtime-mode-module-rendering/after.js Updated “after” assertions mirroring the runtime-mode module rendering expectations.
tests/rspack-test/configCases/rslib/compact-external-dynamic-import-runtime/index.js Test tightened to regex-match __webpack_require__.e( rather than substring check.
tests/rspack-test/configCases/builtin-swc-loader/input-source-map-module/index.js Source-map test updated to include runtime source define_esm_exports.
tests/rspack-test/configCases/builtin-swc-loader/input-source-map-cheap-module/index.js Source-map test updated to include runtime source define_esm_exports.
tests/rspack-test/builtinCases/swc-loader/minify/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/builtinCases/rspack/dynamic-import/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/builtinCases/plugin-wasm/imports-multiple/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...) in async module wrappers.
tests/rspack-test/builtinCases/plugin-javascript/provide/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/builtinCases/plugin-javascript/hashbang/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
tests/rspack-test/builtinCases/plugin-javascript/builtins-define/snapshots/output.snap.txt Snapshot updated to expect __webpack_require__.esm(...).
crates/rspack_plugin_runtime/src/runtime_plugin.rs Runtime plugin now emits DefineEsmExportsRuntimeModule when DEFINE_ESM_EXPORTS is required.
crates/rspack_plugin_runtime/src/runtime_module/runtime/define_esm_exports.ejs New EJS runtime template that composes namespace marking + property getter definition.
crates/rspack_plugin_runtime/src/runtime_module/mod.rs Runtime-module registry updated to include define_esm_exports.
crates/rspack_plugin_runtime/src/runtime_module/define_esm_exports.rs New runtime module implementing DEFINE_ESM_EXPORTS emission and dependencies.
crates/rspack_plugin_javascript/src/dependency/esm/esm_compatibility_dependency.rs Emits combined ESM export init fragment for circular/unknown cases; preserves non-circular split behavior.
crates/rspack_core/src/runtime_globals.rs Adds DEFINE_ESM_EXPORTS and maps it to property name esm.
crates/rspack_core/src/init_fragment.rs Enhances ESMExportInitFragment to optionally emit .esm(...) and merge make_namespace_object intent.
crates/rspack_core/src/concatenated_module.rs Updates concatenated-module namespace/export emission to use .esm(...) when co-located.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants