File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,12 @@ class ProjectPreprocessor {
231
231
return config . kind === "extension" ;
232
232
} ) ;
233
233
234
- const projectClone = JSON . parse ( JSON . stringify ( project ) ) ;
234
+ let projectStringified ;
235
+ if ( extensionConfigs . length ) {
236
+ // Stringify the project before making modifications
237
+ // Using a string to efficiently create multiple independent clones
238
+ projectStringified = JSON . stringify ( project ) ;
239
+ }
235
240
236
241
// While a project can contain multiple configurations,
237
242
// from a dependency tree perspective it is always a single project
@@ -255,7 +260,7 @@ class ProjectPreprocessor {
255
260
256
261
const extensionProjects = extensionConfigs . map ( ( config ) => {
257
262
// Clone original project
258
- const configuredProject = JSON . parse ( JSON . stringify ( projectClone ) ) ;
263
+ const configuredProject = JSON . parse ( projectStringified ) ;
259
264
260
265
// Enhance project with its configuration
261
266
Object . assign ( configuredProject , config ) ;
You can’t perform that action at this time.
0 commit comments