Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve source maps for input files in multiple ways #3219

Open
connorjclark opened this issue Jul 20, 2018 · 0 comments
Open

Resolve source maps for input files in multiple ways #3219

connorjclark opened this issue Jul 20, 2018 · 0 comments

Comments

@connorjclark
Copy link

connorjclark commented Jul 20, 2018

Related to #3058

Currently, there is no way to provide inputs such as this:

src/
- file1.js
- file1.js.map
- file2.js
- file2.js.map
- file3.js

file1.js

console.log('hello');
//# sourceMappingURL=file1.js.map

file2.js

console.log('goodbye');

file3.js

console.log('idkyu');
sourceMappingURL=data:application/json;charset=utf-8;base64,...

And have uglifyjs compose all the input files' source maps together.

The source-map.content option allows for inline, which will correctly compose files like file3.js. The option also also allows for giving the actual source map JSON via the CLI, which I believe only works for a single input file.

I am proposing (and am currently working on) an option for source-map.content called auto, which will attempt to resolve source maps in this way:

  1. If sourceMappingURL is specified, decode the base64 if the source map is inline. If the source mapping url is a resource location (either a file on disk or an HTTP asset), fetch it.
  2. If there is no sourceMappingURL, and the input file name is file.js, look for the source map on disk at file.js.map and file.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants