Build-fix: update snapshotting code to generate a predictable (A-Z) ordering of the snapshotted files
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,7 +10,10 @@ export const getCode = async (bundle, outputOptions, allFiles = false) => {
|
||||
const { output } = await bundle.generate(outputOptions || { format: 'cjs', exports: 'auto' });
|
||||
|
||||
if (allFiles) {
|
||||
return output.map(({ code, fileName, source, map }) => {
|
||||
return output.sort((a,b)=> {
|
||||
if(a.fileName === b.fileName && a.source !== b.source){ return a.source<b.source?-1:1}
|
||||
return a.fileName < b.fileName ? -1 : (a.fileName > b.fileName? 1 : 0);
|
||||
}).map(({ code, fileName, source, map }) => {
|
||||
return {
|
||||
code,
|
||||
fileName,
|
||||
|
||||
Reference in New Issue
Block a user