File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var __migrations = [
55 inlineSourceMapMigration ,
66 addDomLibs ,
77 addIterableToAngularProjects ,
8+ addTnsCoreModulesPathMappings ,
89] ;
910
1011function 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+
8397function getAppPath ( projectDir ) {
8498 const DEFAULT_PATH = "app" ;
8599 const nsConfigPath = path . join ( projectDir , "nsconfig.json" ) ;
You can’t perform that action at this time.
0 commit comments