Skip to content

Commit

Permalink
relative paths for nested source maps (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jul 25, 2020
1 parent 5d602e0 commit 44d0802
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 198 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

This adds support for custom registries hosted at a path other than `/`. Previously the registry had to be hosted at the domain level, like npm itself.

* Nested source maps use relative paths ([#289](https://github.com/evanw/esbuild/issues/289))

The original paths in nested source maps are now modified to be relative to the directory containing the source map. This means source maps from packages inside `node_modules` will stay inside `node_modules` in browser developer tools instead of appearing at the root of the virtual file system where they might collide with the original paths of files in other packages.

## 0.6.6

* Fix minification bug with `this` values for function calls ([#282](https://github.com/evanw/esbuild/issues/282))
Expand Down
2 changes: 1 addition & 1 deletion internal/bundler/bundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func extractSourceMapFromComment(log logging.Log, fs fs.FS, source *logging.Sour
return ast.Path{}, nil
}
contents := string(decoded)
return ast.Path{Text: "sourceMappingURL in " + source.PrettyPath}, &contents
return ast.Path{Text: source.PrettyPath + ".sourceMappingURL"}, &contents
}
}

Expand Down
Loading

0 comments on commit 44d0802

Please sign in to comment.