File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -756,20 +756,17 @@ export async function projectMetadataForInputFile(
756756 input : string ,
757757 project : ProjectContext ,
758758) : Promise < Metadata > {
759- // don't mutate caller
760- project = ld . cloneDeep ( project ) as ProjectContext ;
761-
762759 if ( project . dir && project . config ) {
763760 // If there is directory and configuration information
764761 // process paths
765762 return toInputRelativePaths (
766763 projectType ( project . config ?. project ?. [ kProjectType ] ) ,
767764 project . dir ,
768765 dirname ( input ) ,
769- project . config ,
766+ ld . cloneDeep ( project . config ) ,
770767 ) as Metadata ;
771768 } else {
772769 // Just return the config or empty metadata
773- return project . config || { } ;
770+ return ld . cloneDeep ( project . config ) || { } ;
774771 }
775772}
Original file line number Diff line number Diff line change @@ -653,11 +653,15 @@ async function resolveProjectExtension(
653653 return projectConfig ;
654654}
655655
656+ // migrate 'site' to 'website'
657+ // TODO make this a deprecation warning
656658function migrateProjectConfig ( projectConfig : ProjectConfig ) {
657- projectConfig = ld . cloneDeep ( projectConfig ) ;
658-
659- // migrate 'site' to 'website'
660659 const kSite = "site" ;
660+ if ( projectConfig [ kSite ] === undefined ) {
661+ return projectConfig ;
662+ }
663+
664+ projectConfig = ld . cloneDeep ( projectConfig ) ;
661665 if ( projectConfig . project [ kProjectType ] === kSite ) {
662666 projectConfig . project [ kProjectType ] = kWebsite ;
663667 }
You can’t perform that action at this time.
0 commit comments