File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/cli/src/tools/config Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ function getDependencyConfig(
6464 * Loads CLI configuration
6565 */
6666function loadConfig ( projectRoot : string = process . cwd ( ) ) : ConfigT {
67+ let lazyProject ;
6768 const userConfig = readConfigFromDisk ( projectRoot ) ;
6869
6970 const initialConfig : ConfigT = {
@@ -84,14 +85,19 @@ function loadConfig(projectRoot: string = process.cwd()): ConfigT {
8485 platforms : Object . keys ( userConfig . platforms ) ,
8586 } ,
8687 get project ( ) {
87- const project = { } ;
88+ if ( lazyProject ) {
89+ return lazyProject ;
90+ }
91+
92+ lazyProject = { } ;
8893 for ( const platform in finalConfig . platforms ) {
89- project [ platform ] = finalConfig . platforms [ platform ] . projectConfig (
94+ lazyProject [ platform ] = finalConfig . platforms [ platform ] . projectConfig (
9095 projectRoot ,
9196 userConfig . project [ platform ] || { } ,
9297 ) ;
9398 }
94- return project ;
99+
100+ return lazyProject ;
95101 } ,
96102 } ;
97103
You can’t perform that action at this time.
0 commit comments