Skip to content

Commit 4c3314d

Browse files
committed
chore: revert the tilde resolution as it was removed by mistake
1 parent c629f64 commit 4c3314d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tsconfig-upgrader.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var __migrations = [
55
inlineSourceMapMigration,
66
addDomLibs,
77
addIterableToAngularProjects,
8+
addTnsCoreModulesPathMappings,
89
];
910

1011
function migrateProject(tsConfig, tsconfigPath, projectDir) {
@@ -80,6 +81,19 @@ function addTsLib(existingConfig, libName) {
8081
}
8182
}
8283

84+
function addTnsCoreModulesPathMappings(existingConfig, displayableTsconfigPath, projectDir) {
85+
console.log("Adding tns-core-modules path mappings lib to tsconfig.json...");
86+
existingConfig["compilerOptions"] = existingConfig["compilerOptions"] || {};
87+
var compilerOptions = existingConfig["compilerOptions"];
88+
compilerOptions["baseUrl"] = ".";
89+
compilerOptions["paths"] = compilerOptions["paths"] || {};
90+
91+
const appPath = getAppPath(projectDir);
92+
compilerOptions["paths"]["~/*"] = compilerOptions["paths"]["~/*"] || [
93+
`${appPath}/*`
94+
];
95+
}
96+
8397
function getAppPath(projectDir) {
8498
const DEFAULT_PATH = "app";
8599
const nsConfigPath = path.join(projectDir, "nsconfig.json");

0 commit comments

Comments
 (0)