File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1605,8 +1605,16 @@ export async function toContentTypes(files: IFile[]): Promise<string> {
1605
1605
contentTypes . push ( `<Default Extension="${ extension } " ContentType="${ contentType } "/>` ) ;
1606
1606
}
1607
1607
1608
+ // The files array passed into this function has non-deterministic order
1609
+ // depending on filesystem directory traversal. This leads to the order of
1610
+ // the "Default" elements changing from build to build, which prevents
1611
+ // reproducible vsix files. To fix this, this sorts the contentTypes array
1612
+ // to ensure they are listed in the same order regardless of the order of
1613
+ // the files array.
1614
+ const sortedContentTypes = contentTypes . sort ( ) ;
1615
+
1608
1616
return `<?xml version="1.0" encoding="utf-8"?>
1609
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${ contentTypes . join ( '' ) } </Types>
1617
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${ sortedContentTypes . join ( '' ) } </Types>
1610
1618
` ;
1611
1619
}
1612
1620
You can’t perform that action at this time.
0 commit comments