Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #346 from babel/issue345
Browse files Browse the repository at this point in the history
Ensure explicit targets always override browsers key targets
  • Loading branch information
existentialism authored Jun 2, 2017
2 parents 2896925 + 0017129 commit 00490ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/targets-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,7 @@ const getTargets = (targets = {}) => {
const [parsedTarget, parsedValue] = parser(target, value);

if (parsedValue) {
// Merge (lowest wins)
if (typeof parsedValue === "string") {
results.targets[parsedTarget] = semverMin(
results.targets[parsedTarget],
parsedValue,
);
} else {
// We can remove this block if/when we replace Uglify target
// with top level option
results.targets[parsedTarget] = parsedValue;
}
results.targets[parsedTarget] = parsedValue;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/targets-parser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("getTargets", () => {
}),
{
chrome: "49.0.0",
firefox: "51.0.0",
firefox: "55.0.0",
ie: "9.0.0",
safari: "9.0.0",
},
Expand Down

0 comments on commit 00490ac

Please sign in to comment.