Fix esmodule: "intersect" on iOS versions (#12996)
This commit is contained in:
parent
bc856e03c2
commit
71417bbfcf
@ -9,9 +9,10 @@
|
||||
"opera": "48",
|
||||
"op_mob": "48",
|
||||
"safari": "10.1",
|
||||
"ios_saf": "10.3",
|
||||
"ios": "10.3",
|
||||
"samsung": "8.2",
|
||||
"android": "61",
|
||||
"electron": "2.0"
|
||||
"electron": "2.0",
|
||||
"ios_saf": "10.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ const { addElectronSupportFromChromium } = require("./chromium-to-electron");
|
||||
const browserNameMap = {
|
||||
chrome_android: "and_chr",
|
||||
firefox_android: "and_ff",
|
||||
safari_ios: "ios_saf",
|
||||
safari_ios: "ios",
|
||||
nodejs: "node",
|
||||
webview_android: "android",
|
||||
opera_android: "op_mob",
|
||||
@ -58,8 +58,13 @@ function process(source) {
|
||||
}
|
||||
|
||||
const dataPath = path.join(__dirname, "../data/native-modules.json");
|
||||
const processed = process(compatData.statements.export);
|
||||
// Todo(Babel 8): remove `ios_saf` as it is identical to ios
|
||||
if (processed.ios) {
|
||||
processed.ios_saf = processed.ios;
|
||||
}
|
||||
const data = {
|
||||
"es6.module": process(compatData.statements.export),
|
||||
"es6.module": processed,
|
||||
};
|
||||
fs.writeFileSync(dataPath, `${JSON.stringify(data, null, 2)}\n`);
|
||||
exports.process = process;
|
||||
|
||||
@ -7,6 +7,12 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`getTargets esmodules can be intersected with ios browsers option 1`] = `
|
||||
Object {
|
||||
"ios": "12.0.0",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`getTargets esmodules can be intersected with the browsers option 1`] = `
|
||||
Object {
|
||||
"chrome": "70.0.0",
|
||||
|
||||
@ -245,6 +245,15 @@ describe("getTargets", () => {
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("can be intersected with ios browsers option", () => {
|
||||
expect(
|
||||
getTargets({
|
||||
esmodules: "intersect",
|
||||
browsers: ["ios >= 12"],
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("can be intersected with a .browserslistrc file", () => {
|
||||
expect(
|
||||
getTargets(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user