Skip to content

feat(compiler): add sourcemap support for logic compilation#191

Open
lbb00 wants to merge 2 commits intodidi:mainfrom
EchoTechFE:feat/compiler-sourcemap
Open

feat(compiler): add sourcemap support for logic compilation#191
lbb00 wants to merge 2 commits intodidi:mainfrom
EchoTechFE:feat/compiler-sourcemap

Conversation

@lbb00
Copy link
Copy Markdown
Contributor

@lbb00 lbb00 commented Apr 3, 2026

Sourcemap 支持。场景主要是用于 Devtools 中 console 面板可以映射回源码

  • Add sourcemap.js with mergeSourcemap() and wrapModDefine() utilities
  • Pass sourcemap option through build() -> worker -> logic-compiler
  • In sourcemap mode, skip minification and embed sourcesContent
  • Add sourcemap-bundle tests covering line offset calculation, extraInfoCode handling, and multi-module merging

lbb00 added 2 commits April 3, 2026 15:52
Add --sourcemap option to generate source maps during logic compilation,
enabling easier debugging by mapping bundled code back to original sources.

- Add sourcemap.js with mergeSourcemap() and wrapModDefine() utilities
- Pass sourcemap option through build() -> worker -> logic-compiler
- In sourcemap mode, skip minification and embed sourcesContent
- Add sourcemap-bundle tests covering line offset calculation,
  extraInfoCode handling, and multi-module merging
The wrapModDefine function is only used internally within sourcemap.js,
so it doesn't need to be exported or imported elsewhere.
@lbb00 lbb00 force-pushed the feat/compiler-sourcemap branch from 458acf8 to 3b778d2 Compare April 3, 2026 08:21
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.

1 participant