Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preset-env: fix opera from esmodules target and Browserslist not used #8555

Merged
merged 5 commits into from Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/babel-preset-env/src/targets-parser.js
Expand Up @@ -30,15 +30,16 @@ const validateTargetNames = (validTargets, targets) => {
};

const browserNameMap = {
and_chr: "chrome",
android: "android",
chrome: "chrome",
and_chr: "chrome",
edge: "edge",
firefox: "firefox",
ie: "ie",
ios_saf: "ios",
safari: "safari",
node: "node",
opera: "opera",
safari: "safari",
};

export const isBrowsersQueryValid = (
Expand Down
7 changes: 6 additions & 1 deletion packages/babel-preset-env/test/targets-parser.spec.js
Expand Up @@ -99,11 +99,12 @@ describe("getTargets", () => {
it("works with current node version and string type browsers", () => {
expect(
getTargets({
browsers: "current node, chrome 55",
browsers: "current node, chrome 55, opera 42",
}),
).toEqual({
node: process.versions.node,
chrome: "55.0.0",
opera: "42.0.0",
});
});

Expand Down Expand Up @@ -178,6 +179,7 @@ describe("getTargets", () => {
chrome: "61.0.0",
safari: "10.1.0",
firefox: "60.0.0",
opera: "48.0.0",
ios: "10.3.0",
edge: "16.0.0",
});
Expand All @@ -193,6 +195,7 @@ describe("getTargets", () => {
chrome: "61.0.0",
safari: "10.1.0",
firefox: "60.0.0",
opera: "48.0.0",
ios: "10.3.0",
edge: "16.0.0",
});
Expand All @@ -208,6 +211,7 @@ describe("getTargets", () => {
chrome: "61.0.0",
safari: "10.1.0",
firefox: "60.0.0",
opera: "48.0.0",
ios: "10.3.0",
ie: "11.0.0",
edge: "16.0.0",
Expand All @@ -228,6 +232,7 @@ describe("getTargets", () => {
ie: "11.0.0",
edge: "16.0.0",
firefox: "60.0.0",
opera: "48.0.0",
});
});
});
Expand Down