Skip to content

Add tsconfig.json to resolveImportPath.js #114

@mgs95

Description

@mgs95

Typescript users use a tsconfig.json file instead of a jsconfig.json file. Both contain the include field which is used to get the absolute path.

Inside resolveImportPath.js there should be something like this:

var jsconfigPath = path.resolve(CMD, 'jsconfig.json');
var tsconfigPath = path.resolve(CMD, 'tsconfig.json');
var jsconfigInclude;

if (fs.existsSync(jsconfigPath) || fs.existsSync(tsconfigPath)) {
  var config = fs.readFileSync(jsconfigPath, 'utf8') || fs.readFileSync(tsconfigPath, 'utf8');
  var jsconfig = JSON.parse(config);
  jsconfigInclude = jsconfig.include ? jsconfig.include[0] : null;
}

With this fix, issues regarding absolute paths should be resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions