Skip to content

Commit 8dad2b7

Browse files
committed
fix(scripts/build): handle "preview" version
1 parent 7234b86 commit 8dad2b7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/build/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,15 @@ export const applyMirroring = (feature) => {
9898
const getPreviousVersion = (browser, version) => {
9999
if (typeof version === 'string' && !version.startsWith('≤')) {
100100
const browserVersions = Object.keys(bcd.browsers[browser].releases).sort(
101-
compareVersions,
101+
(a, b) => {
102+
if (a === 'preview') {
103+
return 1;
104+
}
105+
if (b === 'preview') {
106+
return -1;
107+
}
108+
return compareVersions(a, b);
109+
},
102110
);
103111
const currentVersionIndex = browserVersions.indexOf(version);
104112
if (currentVersionIndex > 0) {

0 commit comments

Comments
 (0)