File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1606,18 +1606,24 @@ export class MigrateController
1606
1606
this . spinner . succeed ( `Initialized new ${ "webpack.config.js" . yellow } ` ) ;
1607
1607
1608
1608
const packageJSON = this . $fs . readJson ( projectData . projectFilePath ) ;
1609
- const currentMain = packageJSON . main ;
1609
+ const currentMain = packageJSON . main ?? "app.js" ;
1610
1610
const currentMainTS = currentMain . replace ( / .j s $ / , ".ts" ) ;
1611
1611
1612
1612
const appPath = projectData . appDirectoryPath ;
1613
1613
1614
1614
const possibleMains = [
1615
1615
`./${ appPath } /${ currentMain } ` ,
1616
1616
`./${ appPath } /${ currentMainTS } ` ,
1617
+ `./${ appPath } /main.js` ,
1618
+ `./${ appPath } /main.ts` ,
1617
1619
`./app/${ currentMain } ` ,
1618
1620
`./app/${ currentMainTS } ` ,
1619
1621
`./src/${ currentMain } ` ,
1620
1622
`./src/${ currentMainTS } ` ,
1623
+ `./app/main.js` ,
1624
+ `./app/main.ts` ,
1625
+ `./src/main.js` ,
1626
+ `./src/main.ts` ,
1621
1627
] ;
1622
1628
const replacedMain = possibleMains . find ( ( possibleMain ) => {
1623
1629
return this . $fs . exists ( path . resolve ( projectDir , possibleMain ) ) ;
You can’t perform that action at this time.
0 commit comments