Skip to content

Commit

Permalink
Restore index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Oct 23, 2020
1 parent 4815683 commit 5bd35e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/babel-helper-compilation-targets/src/index.js
Expand Up @@ -2,6 +2,7 @@

import browserslist from "browserslist";
import { findSuggestion } from "@babel/helper-validator-option";
import browserModulesData from "@babel/compat-data/native-modules";

import {
semverify,
Expand Down Expand Up @@ -176,7 +177,10 @@ export default function getTargets(
// `esmodules` as a target indicates the specific set of browsers supporting ES Modules.
// These values OVERRIDE the `browsers` field.
if (inputTargets.esmodules) {
browsers = "supports es6-module";
const supportsESModules = browserModulesData["es6.module"];
browsers = Object.keys(supportsESModules)
.map(browser => `${browser} ${supportsESModules[browser]}`)
.join(", ");
}

// Parse browsers target via browserslist
Expand Down

0 comments on commit 5bd35e8

Please sign in to comment.