Issue 1:
Bug Report

Current Behavior

A clear and concise description of the behavior.

Use npx babel-upgrade --write to update babel, but get this duplication issue, I check them but can't find which plugin or preset is duplicated

Input Code

REPL or Repo link if applicable:

This is new .bablerc file

{
"presets": [
"@babel/preset-react",
"@babel/preset-env",
"@babel/env"
],
"plugins": [
["@babel/plugin-proposal-object-rest-spread", {}, "unique-name-a"],
["@babel/plugin-syntax-dynamic-import", {}, "unique-name-b"],
["@babel/plugin-syntax-import-meta", {}, "unique-name-d"],
["@babel/plugin-proposal-class-properties", {}, "unique-name-c"],
["@babel/plugin-proposal-json-strings", {}, "unique-name-e"],
[
["@babel/plugin-proposal-decorators", {}, "unique-name-p"],
{
"legacy": true
}
],
["@babel/plugin-proposal-function-sent", {}, "unique-name-f"],
["@babel/plugin-proposal-export-namespace-from", {}, "unique-name-g"],
["@babel/plugin-proposal-numeric-separator", {}, "unique-name-h"],
["@babel/plugin-proposal-throw-expressions", {}, "unique-name-i"],
["@babel/plugin-proposal-export-default-from", {}, "unique-name-j"],
["@babel/plugin-proposal-logical-assignment-operators", {}, "unique-name-k"],
["@babel/plugin-proposal-optional-chaining", {}, "unique-name-l"],
[
["@babel/plugin-proposal-pipeline-operator", {}, "unique-name-q"],
{
"proposal": "minimal"
}
],
["@babel/plugin-proposal-nullish-coalescing-operator", {}, "unique-name-m"],
["@babel/plugin-proposal-do-expressions", {}, "unique-name-n"],
["@babel/plugin-proposal-function-bind", {}, "unique-name-o"],
]
}

webpack.config.js file: (didn't do any change)

const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const path = require('path')

module.exports = {
devtool: 'source-map',
entry: [
'babel-polyfill',
'./public/scripts/main',
],
module: {
loaders: [
{test: /.json$/, loader: 'json'},
{test: /\.hbs$/, loader: 'handlebars'},
{test: /.jsx?$/, loader: 'babel', exclude: /node_modules\/(?!ol)/},
],
},
output: {
filename: 'bundle.js',
path: `${__dirname}/public/scripts/`,
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"',
},
}),
new webpack.IgnorePlugin(/regenerator|nodent|js-beautify/, /ajv/),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
dead_code: true,
minimize: true,
}),
],
resolve: {
extensions: [
'',
'.js',
'.json',
'.jsx',
],
alias: {
'ol': path.resolve(__dirname, './', 'node_modules/ol'),
'react': path.resolve(__dirname, './', 'node_modules/react'),
'react-dom': path.resolve(__dirname, './', 'node_modules/react-dom'),
'styled-components': path.resolve(__dirname, './', 'node_modules/styled-components')
}
},
}

Expected behavior/code

A clear and concise description of what you expected to happen (or code).

Babel Configuration (.babelrc, package.json, cli command)

Environment

Babel version(s): 7.00

Node/npm version: Node 8/npm 5]

OS: OSX 10.13.4

Monorepo: [e.g. yes/no/Lerna]

How you are using Babel: loader

Possible Solution

Additional context/Screenshots

Add any other context about the problem here. If applicable, add screenshots to help explain.

Issue 2:
Issue originally reported by @hzoo in babel/babel-preset-env#248

Just going to make another issue to talk about the ideal scenario for both polyfills and babel helpers and how we can get there via babel-preset-env.

How can we write ES20xx and ship the smallest amount of code (for a given target environment)?

syntax: if your target environment supports that syntax, don't compile it (the original point of this project)

polyfill: if your target environment supports that built-in, don't polyfill it (done in babel/babel-preset-env#20 v1.0.0)

polyfill: if your code doesn't actually use the polyfill, don't add it (do a pass over all code to find the use of a built-in) babel/babel-preset-env#241

bundler: do polyfills need to be it's own chunk (webpack)?

babel helpers: reference the same helpers instead of recreating per file (either via https://github.com/babel/babel/tree/7.0/packages/babel-plugin-transform-runtime#options) or (http://babeljs.io/docs/plugins/external-helpers)

babel/babel-preset-env#246 Move transform-runtime into this preset if a library (type: "library")?

babel/babel-preset-env#247 Move external-helpers into this preset if an application (type: "app")?