@@ -11,6 +11,7 @@ import {
11
11
JsonParseMode ,
12
12
Path ,
13
13
join ,
14
+ logging ,
14
15
normalize ,
15
16
parseJson ,
16
17
parseJsonAst ,
@@ -90,7 +91,7 @@ function migrateKarmaConfiguration(config: CliConfig): Rule {
90
91
} ;
91
92
}
92
93
93
- function migrateConfiguration ( oldConfig : CliConfig ) : Rule {
94
+ function migrateConfiguration ( oldConfig : CliConfig , logger : logging . LoggerApi ) : Rule {
94
95
return ( host : Tree , context : SchematicContext ) => {
95
96
const oldConfigPath = getConfigPath ( host ) ;
96
97
const configPath = normalize ( 'angular.json' ) ;
@@ -99,7 +100,7 @@ function migrateConfiguration(oldConfig: CliConfig): Rule {
99
100
'$schema' : './node_modules/@angular/cli/lib/config/schema.json' ,
100
101
version : 1 ,
101
102
newProjectRoot : 'projects' ,
102
- projects : extractProjectsConfig ( oldConfig , host ) ,
103
+ projects : extractProjectsConfig ( oldConfig , host , logger ) ,
103
104
} ;
104
105
const defaultProject = extractDefaultProject ( oldConfig ) ;
105
106
if ( defaultProject !== null ) {
@@ -211,7 +212,9 @@ function extractArchitectConfig(_config: CliConfig): JsonObject | null {
211
212
return null ;
212
213
}
213
214
214
- function extractProjectsConfig ( config : CliConfig , tree : Tree ) : JsonObject {
215
+ function extractProjectsConfig (
216
+ config : CliConfig , tree : Tree , logger : logging . LoggerApi ,
217
+ ) : JsonObject {
215
218
const builderPackage = '@angular-devkit/build-angular' ;
216
219
const defaultAppNamePrefix = getDefaultAppNamePrefix ( config ) ;
217
220
@@ -256,7 +259,14 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
256
259
if ( typeof asset === 'string' ) {
257
260
return normalize ( appRoot + '/' + asset ) ;
258
261
} else {
259
- if ( asset . output ) {
262
+ if ( asset . allowOutsideOutDir ) {
263
+ logger . warn ( tags . oneLine `
264
+ Asset with input '${ asset . input } ' was not migrated because it
265
+ uses the 'allowOutsideOutDir' option which is not supported in Angular CLI 6.
266
+ ` ) ;
267
+
268
+ return null ;
269
+ } else if ( asset . output ) {
260
270
return {
261
271
glob : asset . glob ,
262
272
input : normalize ( appRoot + '/' + asset . input ) ,
@@ -409,7 +419,7 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
409
419
} ;
410
420
}
411
421
412
- buildOptions . assets = ( app . assets || [ ] ) . map ( _mapAssets ) ;
422
+ buildOptions . assets = ( app . assets || [ ] ) . map ( _mapAssets ) . filter ( x => ! ! x ) ;
413
423
buildOptions . styles = ( app . styles || [ ] ) . map ( _extraEntryMapper ) ;
414
424
buildOptions . scripts = ( app . scripts || [ ] ) . map ( _extraEntryMapper ) ;
415
425
architect . build = {
@@ -455,7 +465,7 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
455
465
}
456
466
testOptions . scripts = ( app . scripts || [ ] ) . map ( _extraEntryMapper ) ;
457
467
testOptions . styles = ( app . styles || [ ] ) . map ( _extraEntryMapper ) ;
458
- testOptions . assets = ( app . assets || [ ] ) . map ( _mapAssets ) ;
468
+ testOptions . assets = ( app . assets || [ ] ) . map ( _mapAssets ) . filter ( x => ! ! x ) ;
459
469
460
470
if ( karmaConfig ) {
461
471
architect . test = {
@@ -752,7 +762,7 @@ export default function (): Rule {
752
762
753
763
return chain ( [
754
764
migrateKarmaConfiguration ( config ) ,
755
- migrateConfiguration ( config ) ,
765
+ migrateConfiguration ( config , context . logger ) ,
756
766
updateSpecTsConfig ( config ) ,
757
767
updatePackageJson ( config ) ,
758
768
updateTsLintConfig ( ) ,
0 commit comments