Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 9d73a27

Browse files
author
Dimitar Tachev
authored
Merge pull request #1110 from NativeScript/tachev/fix-missing-paths
fix: handle missing paths obj in tsconfig
2 parents 9902999 + 867a9f1 commit 9d73a27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ function replacePathInCompilerOptions({ compilerOptions, targetPath, replacement
242242
}
243243

244244
function ensurePathInCompilerOptions({ compilerOptions, sourcePath, destinationPath }) {
245-
const paths = (compilerOptions && compilerOptions.paths) || {};
245+
compilerOptions = compilerOptions || {};
246+
compilerOptions.paths = compilerOptions.paths || {};
247+
const paths = compilerOptions.paths;
246248
if (paths[sourcePath]) {
247249
if (Array.isArray(paths[sourcePath]) && paths[sourcePath].indexOf(destinationPath) === -1) {
248250
paths[sourcePath].push(destinationPath);

0 commit comments

Comments
 (0)