@@ -168,6 +168,7 @@ async function generateWebpackConfig(
168168 remoteMap : Record < string , string > ,
169169 projectRoot : string ,
170170 projectSourceRoot : string ,
171+ appComponent : string ,
171172 options : MfSchematicSchema
172173) {
173174 const tmpl = url ( './files' ) ;
@@ -178,6 +179,7 @@ async function generateWebpackConfig(
178179 projectSourceRoot,
179180 remoteMap,
180181 ...options ,
182+ appComponent,
181183 tmpl : '' ,
182184 } ) ,
183185 move ( projectRoot ) ,
@@ -286,6 +288,15 @@ export default function config(options: MfSchematicSchema): Rule {
286288
287289 const remoteMap = await generateRemoteMap ( workspace , projectName ) ;
288290
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+
289300 let generateRule = null ;
290301
291302 if ( options . type === 'legacy' ) {
@@ -302,6 +313,7 @@ export default function config(options: MfSchematicSchema): Rule {
302313 remoteMap ,
303314 projectRoot ,
304315 projectSourceRoot ,
316+ appComponent ,
305317 options
306318 ) ;
307319 }
@@ -353,6 +365,14 @@ export default function config(options: MfSchematicSchema): Rule {
353365 projectConfig . architect . serve . options = { } ;
354366 }
355367
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+
356376 projectConfig . architect . build . builder = buildBuilder ;
357377 projectConfig . architect . build . options [ webpackProperty ] =
358378 getWebpackConfigValue ( options . nxBuilders , configPath ) ;
@@ -403,14 +423,31 @@ export default function config(options: MfSchematicSchema): Rule {
403423
404424 const dep = getPackageJsonDependency ( tree , 'ngx-build-plus' ) ;
405425
406- if ( ! dep || ! semver . satisfies ( dep . version , '>=19.0.0' ) ) {
426+ let installDeps = false ;
427+ if ( ! dep || ! semver . satisfies ( dep . version , '>=20.0.0' ) ) {
407428 addPackageJsonDependency ( tree , {
408429 name : 'ngx-build-plus' ,
409430 type : NodeDependencyType . Dev ,
410- version : '^19 .0.0' ,
431+ version : '^20 .0.0' ,
411432 overwrite : true ,
412433 } ) ;
413434
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 ) {
414451 context . addTask ( new NodePackageInstallTask ( ) ) ;
415452 }
416453
0 commit comments