Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Source map paths are relative to baseURL, instead of outPath #58

Closed
guybedford opened this issue Jan 29, 2015 · 8 comments · Fixed by #73
Closed

Source map paths are relative to baseURL, instead of outPath #58

guybedford opened this issue Jan 29, 2015 · 8 comments · Fixed by #73
Assignees

Comments

@guybedford
Copy link
Member

The source map chaining in https://github.com/systemjs/builder/blob/master/compilers/es6.js#L59 seems to work correctly.

But I'm not sure why it isn't failing because the sources array contains module names like file instead of file.js.

Given this, how is Traceur knowing that the original file is file.js? Is it from load.address? That seems like the wrong assumption to be making?

@crisptrutski
Copy link
Contributor

Haven't look at that at all. Is this really a chaining issue though, perhaps I'm misunderstanding but sounds like the issue is with the vanilla traceur sourcemap or the input map (chaining should not generate any source names of its own)

@guybedford
Copy link
Member Author

@crisptrutski did you manage to look into this?

@crisptrutski
Copy link
Contributor

Took a quick look - those names are coming from load.name (https://github.com/systemjs/builder/blob/master/compilers/es6.js#L44). We don't seem to have the base path in scope here (we could work backwards from the name.. hacky).

Seems we might as well just yank the extension (if any) from the address and just plonk that on. 🐐

@guybedford
Copy link
Member Author

Thanks, I'm wondering if I had my test case wrong - it should pick up the original source names from the first source file if chaining source maps being the point.

Would be nice to verify these are working correctly with some more test cases. Including if the original file was compiled from a few separate files into ES6, and then compiled into ES5, those first files should display as individual entries when debugging.

@crisptrutski
Copy link
Contributor

Sure - will write specs for [6to5, traceur] x [single, multiple] source map output cases, given fixture files.

@guybedford
Copy link
Member Author

Thanks that would be great.

This was referenced Feb 9, 2015
@crisptrutski crisptrutski changed the title source map chaining question Source map paths are relative to basURL, instead of outPath Feb 12, 2015
@crisptrutski crisptrutski changed the title Source map paths are relative to basURL, instead of outPath Source map paths are relative to baseURL, instead of outPath Feb 12, 2015
@crisptrutski
Copy link
Contributor

Hijacking this issue for key issue. Will keep "relative to baseURL" as behaviour for in-memory builds

@guybedford
Copy link
Member Author

Perfect.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants