Skip to content

Commit a4693ef

Browse files
squash-me: remove unnecessary (and very naughty) chdir() call
1 parent 9d5f760 commit a4693ef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎docs/dgeni-package/services/tsParser.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var ts = require('typescript');
2+
var path = require('canonical-path');
23

34
module.exports = function tsParser(createCompilerHost, log) {
45

@@ -9,9 +10,9 @@ module.exports = function tsParser(createCompilerHost, log) {
910
},
1011

1112
parse: function(fileNames, baseDir) {
12-
// This is the easiest way I could find to ensure that we loaded
13-
// modules with paths relative to the baseDir
14-
process.chdir(baseDir);
13+
fileNames = fileNames.map(function(fileName) {
14+
return path.resolve(baseDir, fileName);
15+
});
1516

1617
// "Compile" a program from the given module filenames, to get hold of a
1718
// typeChecker that can be used to interrogate the modules, exports and so on.

0 commit comments

Comments
 (0)