File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var __migrations = [
5
5
inlineSourceMapMigration ,
6
6
addDomLibs ,
7
7
addIterableToAngularProjects ,
8
+ addTnsCoreModulesPathMappings ,
8
9
] ;
9
10
10
11
function migrateProject ( tsConfig , tsconfigPath , projectDir ) {
@@ -80,6 +81,19 @@ function addTsLib(existingConfig, libName) {
80
81
}
81
82
}
82
83
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
+
83
97
function getAppPath ( projectDir ) {
84
98
const DEFAULT_PATH = "app" ;
85
99
const nsConfigPath = path . join ( projectDir , "nsconfig.json" ) ;
You can’t perform that action at this time.
0 commit comments