enforce stable sort

This commit is contained in:
Rich-Harris
2018-03-25 15:12:35 -04:00
parent 3220c522d7
commit 25809ec409
2 changed files with 45 additions and 3 deletions

View File

@@ -102,7 +102,10 @@ export default function create_routes({ files } = { files: glob.sync('**/*.*', {
}
if (!a_sub_part.dynamic && a_sub_part.content !== b_sub_part.content) {
return b_sub_part.content.length - a_sub_part.content.length;
return (
(b_sub_part.content.length - a_sub_part.content.length) ||
(a_sub_part.content < b_sub_part.content ? -1 : 1)
);
}
}
}