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

Add support for sourceRoot and mapRoot options #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ grunt.initConfig({
| jsx | string | Support JSX in '.tsx' files: 'React' or 'Preserve'. |
| experimentalAsyncFunctions | boolean | Support ES7-proposed asynchronous functions using the async/await keywords. |
| rootDir | string | Specifies the root directory of input files. Only use to control the output directory structure with outDir option. |
| mapRoot | string | Specifies the location where debugger should locate map files instead of generated locations. |
| sourceRoot | string | Specifies the location where debugger should locate TypeScript files instead of source locations. |

### original options

Expand Down
10 changes: 7 additions & 3 deletions src/modules/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ export function createGruntOption(source: any, grunt: IGrunt, gruntFile: grunt.f
targetVersion = prepareTarget(source),
basePath = checkBasePath(source),
rootDir = util.isStr(source.rootDir) ? source.rootDir : undefined,
keepDirectoryHierarchy = boolOrUndef(source, "keepDirectoryHierarchy");
keepDirectoryHierarchy = boolOrUndef(source, "keepDirectoryHierarchy"),
sourceRoot = util.isStr(source.sourceRoot) ? source.sourceRoot : undefined,
mapRoot = util.isStr(source.mapRoot) ? source.mapRoot : undefined;

function getTargetFiles(): string[]{
return <string[]>grunt.file.expand(<string[]>gruntFile.orig.src);
}


function getReferences(): string[]{
let target: string[],
Expand Down Expand Up @@ -282,7 +284,9 @@ export function createGruntOption(source: any, grunt: IGrunt, gruntFile: grunt.f
inlineSources: boolOrUndef(source, "inlineSources"),
noEmitHelpers: boolOrUndef(source, "noEmitHelpers"),
jsx: prepareJsx(source),
experimentalAsyncFunctions: boolOrUndef(source, "experimentalAsyncFunctions")
experimentalAsyncFunctions: boolOrUndef(source, "experimentalAsyncFunctions"),
sourceRoot: sourceRoot,
mapRoot: mapRoot
}
};

Expand Down