Issue 1:
Bug Report

Current Behavior

I want to use preset-env to transform my code to support low browsers like ie 8, but the bundle code does not include the polyfill code.

Input Code

console.log([1, 2, 3, 4].includes(4));

let m = new Map([[1, 2], [2, 4], [4, 8]]);
console.log(Array.from(m));

output

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';

console.log([1, 2, 3, 4].includes(4));

var m = new Map([[1, 2], [2, 4], [4, 8]]);
console.log(Array.from(m));

})));

Config info

package.json

{
"name": "rollupexample",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "rollup --config ./rollup.config.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"babel-polyfill": "^6.26.0"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"rollup": "^0.65.0",
"rollup-plugin-babel": "^2.7.1"
},
"author": "",
"license": "ISC"
}

rollup.config.js

import babel from 'rollup-plugin-babel';

export default [
{
input: 'index.js',
output: {
file: 'bundle.js',
format: 'umd',
name: 'lib'
},
plugins: [
babel({
babelrc: false,
exclude: ['node_modules/**'],
presets: [
[
'env',
{
targets: {
browsers: [
'ios > 8',
'android > 4.2',
'and_chr > 38',
'and_ff > 56',
'and_qq > 1.1',
'and_uc > 9',
'ie_mob > 10',
'ie >= 7'
]
},
loose: true,
modules: false,
useBuiltIns: 'usage',
debug: true
}
]
]
})
]
}
];

Extra Info

I got this from debug

babel-preset-env: `DEBUG` option

Using targets:
{
"chrome": "67",
"android": "4.4",
"ie": "7",
"ios": "8.1"
}

Modules transform: false

Using plugins:
check-es2015-constants {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-arrow-functions {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-block-scoped-functions {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-block-scoping {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-classes {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-computed-properties {"android":"4.4","ie":"7"}
transform-es2015-destructuring {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-duplicate-keys {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-for-of {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-function-name {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-literals {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-object-super {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-parameters {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-shorthand-properties {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-spread {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-sticky-regex {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-template-literals {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-typeof-symbol {"android":"4.4","ie":"7","ios":"8.1"}
transform-es2015-unicode-regex {"android":"4.4","ie":"7","ios":"8.1"}
transform-regenerator {"android":"4.4","ie":"7","ios":"8.1"}
transform-exponentiation-operator {"android":"4.4","ie":"7","ios":"8.1"}
transform-async-to-generator {"android":"4.4","ie":"7","ios":"8.1"}
syntax-trailing-function-commas {"android":"4.4","ie":"7","ios":"8.1"}

Using polyfills:
es6.typed.array-buffer {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.data-view {"ie":"7"}
es6.typed.int8-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.uint8-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.uint8-clamped-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.int16-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.uint16-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.int32-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.uint32-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.float32-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.typed.float64-array {"android":"4.4","ie":"7","ios":"8.1"}
es6.map {"android":"4.4","ie":"7","ios":"8.1"}
es6.set {"android":"4.4","ie":"7","ios":"8.1"}
es6.weak-map {"android":"4.4","ie":"7","ios":"8.1"}
es6.weak-set {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.apply {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.construct {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.define-property {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.delete-property {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.get {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.get-own-property-descriptor {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.get-prototype-of {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.has {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.is-extensible {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.own-keys {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.prevent-extensions {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.set {"android":"4.4","ie":"7","ios":"8.1"}
es6.reflect.set-prototype-of {"android":"4.4","ie":"7","ios":"8.1"}
es6.promise {"android":"4.4","ie":"7","ios":"8.1"}
es6.symbol {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.freeze {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.seal {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.prevent-extensions {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.is-frozen {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.is-sealed {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.is-extensible {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.get-own-property-descriptor {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.get-prototype-of {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.keys {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.get-own-property-names {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.assign {"android":"4.4","ie":"7","ios":"8.1"}
es6.object.is {"ie":"7","ios":"8.1"}
es6.object.set-prototype-of {"android":"4.4","ie":"7","ios":"8.1"}
es6.function.name {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.raw {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.from-code-point {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.code-point-at {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.repeat {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.starts-with {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.ends-with {"android":"4.4","ie":"7","ios":"8.1"}
es6.string.includes {"android":"4.4","ie":"7","ios":"8.1"}
es6.regexp.flags {"android":"4.4","ie":"7","ios":"8.1"}
es6.regexp.match {"android":"4.4","ie":"7","ios":"8.1"}
es6.regexp.replace {"android":"4.4","ie":"7","ios":"8.1"}
es6.regexp.split {"android":"4.4","ie":"7","ios":"8.1"}
es6.regexp.search {"android":"4.4","ie":"7","ios":"8.1"}
es6.array.from {"android":"4.4","ie":"7","ios":"8.1"}
es6.array.of {"android":"4.4","ie":"7","ios":"8.1"}
es6.array.copy-within {"android":"4.4","ie":"7","ios":"8.1"}
es6.array.find {"android":"4.4","ie":"7"}
es6.array.find-index {"android":"4.4","ie":"7"}
es6.array.fill {"android":"4.4","ie":"7"}
es6.array.iterator {"android":"4.4","ie":"7"}
es6.number.is-finite {"ie":"7","ios":"8.1"}
es6.number.is-integer {"android":"4.4","ie":"7","ios":"8.1"}
es6.number.is-safe-integer {"android":"4.4","ie":"7","ios":"8.1"}
es6.number.is-nan {"ie":"7","ios":"8.1"}
es6.number.epsilon {"android":"4.4","ie":"7","ios":"8.1"}
es6.number.min-safe-integer {"android":"4.4","ie":"7","ios":"8.1"}
es6.number.max-safe-integer {"android":"4.4","ie":"7","ios":"8.1"}
es6.math.acosh {"android":"4.4","ie":"7"}
es6.math.asinh {"android":"4.4","ie":"7"}
es6.math.atanh {"android":"4.4","ie":"7"}
es6.math.cbrt {"android":"4.4","ie":"7"}
es6.math.clz32 {"android":"4.4","ie":"7","ios":"8.1"}
es6.math.cosh {"android":"4.4","ie":"7"}
es6.math.expm1 {"android":"4.4","ie":"7"}
es6.math.fround {"android":"4.4","ie":"7"}
es6.math.hypot {"android":"4.4","ie":"7"}
es6.math.imul {"ie":"7"}
es6.math.log1p {"android":"4.4","ie":"7"}
es6.math.log10 {"android":"4.4","ie":"7"}
es6.math.log2 {"android":"4.4","ie":"7"}
es6.math.sign {"android":"4.4","ie":"7","ios":"8.1"}
es6.math.sinh {"android":"4.4","ie":"7"}
es6.math.tanh {"android":"4.4","ie":"7"}
es6.math.trunc {"android":"4.4","ie":"7"}
es7.array.includes {"android":"4.4","ie":"7","ios":"8.1"}
es7.object.values {"android":"4.4","ie":"7","ios":"8.1"}
es7.object.entries {"android":"4.4","ie":"7","ios":"8.1"}
es7.object.get-own-property-descriptors {"android":"4.4","ie":"7","ios":"8.1"}
es7.string.pad-start {"android":"4.4","ie":"7","ios":"8.1"}
es7.string.pad-end {"android":"4.4","ie":"7","ios":"8.1"}
web.timers {"chrome":"67","android":"4.4","ie":"7","ios":"8.1"}
web.immediate {"chrome":"67","android":"4.4","ie":"7","ios":"8.1"}
web.dom.iterable {"chrome":"67","android":"4.4","ie":"7","ios":"8.1"}

Environment

Babel version(s): [babel-core@6.26.3]

Node/npm version: [v10.3.0 / 6.1.0]

OS: [OSX 12]

How you are using Babel: [loader]

Issue 2:
Bug Report

File extensions are required in import statements in ES Modules.

But files within @babel/runtime/helpers/esm (which are treated as ES Modules because @babel/runtime/helpers/esm/package.json contains type: "module") don't use extensions in their import statements.

I would like to work on a fix!

Current behavior

I'm getting this correct error with Webpack 5:

ERROR in ./node_modules/@babel/runtime/helpers/esm/get.js 1:0-44
Module not found: Error: Can't resolve './superPropBase' in '/Users/andy/clarity/node_modules/@babel/runtime/helpers/esm'
Did you mean 'superPropBase.js'?
BREAKING CHANGE: The request './superPropBase' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

This is because the first line of @babel/runtime/helpers/esm/get.js is an import without an extension:

import superPropBase from "./superPropBase";

Input Code

var your => (code) => here;

Expected behavior

No problems using @babel/plugin-transform-runtime with useESModules: true

Babel Configuration

Filename: (babel config inlined in babel-loader webpack config)

{
presets: [
['@babel/preset-env', {targets: {browsers: 'last 2 versions'}}],
],
plugins: [
[
'@babel/plugin-transform-runtime',
{
useESModules: true,
},
],
]
}

Environment

@babel/runtime: 7.11.2

@babel/plugin-transform-runtime: 7.11.5

webpack: 5.0.0-rc.4

babel-loader: 8.1.0

Possible Solution

Use full extensions in imports inside @babel/runtime/helpers/esm, so I don't get these errors, for example:

import superPropBase from "./superPropBase.js";