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

Not producing relative sourceMappingUrl's with mapRoot #10612

Closed
agubler opened this issue Aug 30, 2016 · 3 comments
Closed

Not producing relative sourceMappingUrl's with mapRoot #10612

agubler opened this issue Aug 30, 2016 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@agubler
Copy link

agubler commented Aug 30, 2016

TypeScript Version(s): 2.1.0-dev.20160830 / 2.0.0 / 2.0.2

Code

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": false,
        "mapRoot": "./_debug",
        "sourceMap": true
    }
}
const example = function(options: { option1: string, options2: any }) {
        //noop
}

export default example;

Running tsc -p .

Expected behavior:

"use strict";
var example = function (options) {
    //noop
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = example;
//# sourceMappingURL=_debug/main.js.map

Actual behavior:

"use strict";
var example = function (options) {
    //noop
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = example;
//# sourceMappingURL=/Users/user1/ts-rel-root/_debug/main.js.map
@matt-gadd
Copy link

matt-gadd commented Sep 15, 2016

This seems to affect sourceRoot in the same way unfortunately.

@saulshanabrook
Copy link

I would like to be able to use the mapRoot to change the sources field in the sourcemap, without making the sourceMappingURL absolute. This is an issue for us, because we build the typescript files in one place and then copy them to another before importing them. When we copy them, relative path in the sources field no longer correctly points to the source file. We can mitigate this by using the mapRoot, but then this changes the sourceMappingURL to be absolute, and points to the previous location, so then it is not picked up.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 2, 2018

Should be fixed by #23989

@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Jul 2, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jul 2, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jul 2, 2018
@mhegazy mhegazy closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants