@@ -168,6 +168,7 @@ async function generateWebpackConfig(
168
168
remoteMap : Record < string , string > ,
169
169
projectRoot : string ,
170
170
projectSourceRoot : string ,
171
+ appComponent : string ,
171
172
options : MfSchematicSchema
172
173
) {
173
174
const tmpl = url ( './files' ) ;
@@ -178,6 +179,7 @@ async function generateWebpackConfig(
178
179
projectSourceRoot,
179
180
remoteMap,
180
181
...options ,
182
+ appComponent,
181
183
tmpl : '' ,
182
184
} ) ,
183
185
move ( projectRoot ) ,
@@ -286,6 +288,15 @@ export default function config(options: MfSchematicSchema): Rule {
286
288
287
289
const remoteMap = await generateRemoteMap ( workspace , projectName ) ;
288
290
291
+ const cand1 = path . join ( projectSourceRoot , 'app' , 'app.component.ts' ) ;
292
+ const cand2 = path . join ( projectSourceRoot , 'app' , 'app.ts' ) ;
293
+
294
+ const appComponent = tree . exists ( cand1 )
295
+ ? cand1
296
+ : tree . exists ( cand2 )
297
+ ? cand2
298
+ : 'update-this.ts' ;
299
+
289
300
let generateRule = null ;
290
301
291
302
if ( options . type === 'legacy' ) {
@@ -302,6 +313,7 @@ export default function config(options: MfSchematicSchema): Rule {
302
313
remoteMap ,
303
314
projectRoot ,
304
315
projectSourceRoot ,
316
+ appComponent ,
305
317
options
306
318
) ;
307
319
}
@@ -353,6 +365,14 @@ export default function config(options: MfSchematicSchema): Rule {
353
365
projectConfig . architect . serve . options = { } ;
354
366
}
355
367
368
+ const indexPath = path . join ( projectSourceRoot , 'index.html' ) ;
369
+
370
+ projectConfig . architect . build . options . outputPath =
371
+ projectConfig . architect . build . options . outputPath ?? `dist/${ projectName } ` ;
372
+
373
+ projectConfig . architect . build . options . index =
374
+ projectConfig . architect . build . options . index ?? indexPath ;
375
+
356
376
projectConfig . architect . build . builder = buildBuilder ;
357
377
projectConfig . architect . build . options [ webpackProperty ] =
358
378
getWebpackConfigValue ( options . nxBuilders , configPath ) ;
@@ -403,14 +423,31 @@ export default function config(options: MfSchematicSchema): Rule {
403
423
404
424
const dep = getPackageJsonDependency ( tree , 'ngx-build-plus' ) ;
405
425
406
- if ( ! dep || ! semver . satisfies ( dep . version , '>=19.0.0' ) ) {
426
+ let installDeps = false ;
427
+ if ( ! dep || ! semver . satisfies ( dep . version , '>=20.0.0' ) ) {
407
428
addPackageJsonDependency ( tree , {
408
429
name : 'ngx-build-plus' ,
409
430
type : NodeDependencyType . Dev ,
410
- version : '^19 .0.0' ,
431
+ version : '^20 .0.0' ,
411
432
overwrite : true ,
412
433
} ) ;
413
434
435
+ installDeps = true ;
436
+ }
437
+
438
+ if ( ! getPackageJsonDependency ( tree , '@angular-devkit/build-angular' ) ) {
439
+ addPackageJsonDependency ( tree , {
440
+ name : '@angular-devkit/build-angular' ,
441
+ type : NodeDependencyType . Dev ,
442
+ version :
443
+ getPackageJsonDependency ( tree , '@angular/cli' ) ?. version || 'latest' ,
444
+ overwrite : false ,
445
+ } ) ;
446
+
447
+ installDeps = true ;
448
+ }
449
+
450
+ if ( installDeps ) {
414
451
context . addTask ( new NodePackageInstallTask ( ) ) ;
415
452
}
416
453
0 commit comments