NOSSLETTER.techLIVE
back to archive

sea: add source maps for SEA with VFS

Language: JavaScript+336 -0feature
concepts demonstrated
Source mapsVirtual file system (VFS) integrationError stack trace mappingAutomated testing with source map validation
The Issue & Context

Before this PR, single executable applications built with the SEA tool using the virtual file system (VFS) option could not load or apply source maps, causing stack traces and error previews to reference only compiled code rather than original sources.

Root Cause Analysis

The existing SEA source map handling did not integrate with the VFS layer, so `.map` files and original source assets bundled inside the virtual file system archive were inaccessible to the source map resolver and error reporting mechanisms.

Solution Strategy & Architectural Pattern

This PR extends SEA's source map support to read `.map` files and original sources through the VFS abstraction, updating `module.findSourceMap()` and error preview logic to resolve source maps from the mounted virtual file system or archive. It also adds tests verifying source map resolution and stack trace remapping for both inline assets and zipped VFS archives.

Key Takeaway for Contributors

When bundling source maps into virtual file systems or archives, tooling must explicitly bridge source map resolution with the VFS layer to preserve developer-friendly debugging and error reporting.