Skip to content

Enable Sourcemap Output - #39

Merged
abimaelmartell merged 6 commits into
mainfrom
enable-source-maps
Aug 11, 2025
Merged

Enable Sourcemap Output#39
abimaelmartell merged 6 commits into
mainfrom
enable-source-maps

Conversation

@abimaelmartell

@abimaelmartell abimaelmartell commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

This pull request adds robust support for source map generation in the bundling process, allowing users to choose between inline, external, or no source maps. It updates the CLI and internal APIs to handle these options, ensures correct file outputs, and introduces comprehensive tests to verify the new functionality.

Source map support in bundling:

  • Enhanced the bundle function to accept a sourcemap option (inline, external, or none) and return both the bundled code and, if applicable, the source map. The implementation writes external source maps to a temporary file due to esbuild limitations. [1] [2]
  • Updated all usages of the bundle function across the codebase to handle the new return type and options, including CLI commands and tests. [1] [2] [3] [4] [5]

CLI improvements:

  • Extended the bundle CLI command to accept a --sourcemap option, validated its value, and handled writing external source map files alongside the bundle output. Updated help and examples accordingly.

Testing:

  • Added a new test suite (tests/bundle/sourcemap.test.ts) with thorough coverage for all source map options, including validation of inline/external maps, bundle size comparisons, and platform compatibility.

Other updates:

  • Minor refactor in example usage to use the correct middleware factory function.

@abimaelmartell abimaelmartell changed the title Implement Sourcemap Generation Enable Sourcemap Output Aug 11, 2025
@abimaelmartell
abimaelmartell marked this pull request as ready for review August 11, 2025 23:21
@abimaelmartell
abimaelmartell merged commit 971e548 into main Aug 11, 2025
13 of 14 checks passed
@abimaelmartell
abimaelmartell deleted the enable-source-maps branch August 11, 2025 23:50
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