Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Better sourcemap source resolution #69

@Rich-Harris

Description

@Rich-Harris

A sourcemap source is the first file that doesn't have an associated sourcemap, but that means that if you have a build like this...

module.exports = gobble( 'src' )
  .grab( 'js' )
  .exclude( 'whatever.js' )
  .transform( 'babel' );

...then as far as babel is concerned, the source files are .gobble/02-exclude/[files].js. So that's what shows up in the sources pane in-browser.

Since gobble now owns the sourcemap pipeline, it'd be nice to fix those so that the correct sources are revealed, at least on a best effort basis. On OS X it would be easy enough to just trace the symlinks back to their origin (since in the majority of cases, they will be symlinks to files in an original source dir), but that doesn't work on Windows where symlinks can't be used. So it might take a slightly more sophisticated approach. Perhaps if we store checksums of all the source files, then we can read any sources in the final sourcemaps that live inside .gobble, find their checksums, and match them up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions