<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
A clear and concise description of the behavior.<br>
Use <code class="notranslate">npx babel-upgrade --write</code> to update babel, but get this duplication issue, I check them but can't find which plugin or preset is duplicated<br>
<strong>Input Code</strong></p>
<ul dir="auto">
<li>REPL or Repo link if applicable:<br>
This is new .bablerc file</li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [
        &quot;@babel/preset-react&quot;,
        &quot;@babel/preset-env&quot;,
        &quot;@babel/env&quot;
    ],
    &quot;plugins&quot;: [
        [&quot;@babel/plugin-proposal-object-rest-spread&quot;, {}, &quot;unique-name-a&quot;],
        [&quot;@babel/plugin-syntax-dynamic-import&quot;, {}, &quot;unique-name-b&quot;],
        [&quot;@babel/plugin-syntax-import-meta&quot;, {}, &quot;unique-name-d&quot;],
        [&quot;@babel/plugin-proposal-class-properties&quot;, {}, &quot;unique-name-c&quot;],
        [&quot;@babel/plugin-proposal-json-strings&quot;, {}, &quot;unique-name-e&quot;],
        [
            [&quot;@babel/plugin-proposal-decorators&quot;, {}, &quot;unique-name-p&quot;],
            {
                &quot;legacy&quot;: true
            }
        ],
        [&quot;@babel/plugin-proposal-function-sent&quot;, {}, &quot;unique-name-f&quot;],
        [&quot;@babel/plugin-proposal-export-namespace-from&quot;, {}, &quot;unique-name-g&quot;],
        [&quot;@babel/plugin-proposal-numeric-separator&quot;, {}, &quot;unique-name-h&quot;],
        [&quot;@babel/plugin-proposal-throw-expressions&quot;, {}, &quot;unique-name-i&quot;],
        [&quot;@babel/plugin-proposal-export-default-from&quot;, {}, &quot;unique-name-j&quot;],
        [&quot;@babel/plugin-proposal-logical-assignment-operators&quot;, {}, &quot;unique-name-k&quot;],
        [&quot;@babel/plugin-proposal-optional-chaining&quot;, {}, &quot;unique-name-l&quot;],
        [
            [&quot;@babel/plugin-proposal-pipeline-operator&quot;, {}, &quot;unique-name-q&quot;],
            {
                &quot;proposal&quot;: &quot;minimal&quot;
            }
        ],
        [&quot;@babel/plugin-proposal-nullish-coalescing-operator&quot;, {}, &quot;unique-name-m&quot;],
        [&quot;@babel/plugin-proposal-do-expressions&quot;, {}, &quot;unique-name-n&quot;],
        [&quot;@babel/plugin-proposal-function-bind&quot;, {}, &quot;unique-name-o&quot;],
    ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
    <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"@babel/preset-react"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/preset-env"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/env"</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-object-rest-spread"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-a"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-syntax-dynamic-import"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-b"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-syntax-import-meta"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-d"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-class-properties"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-c"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-json-strings"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-e"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-decorators"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-p"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"legacy"</span>: <span class="pl-c1">true</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-function-sent"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-f"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-export-namespace-from"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-g"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-numeric-separator"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-h"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-throw-expressions"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-i"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-export-default-from"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-j"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-logical-assignment-operators"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-k"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-optional-chaining"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-l"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span>
            <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-pipeline-operator"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-q"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">{</span>
                <span class="pl-s">"proposal"</span>: <span class="pl-s">"minimal"</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-nullish-coalescing-operator"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-m"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-do-expressions"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-n"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">[</span><span class="pl-s">"@babel/plugin-proposal-function-bind"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"unique-name-o"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">webpack.config.js file: (didn't do any change)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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: '&quot;production&quot;',
      },
    }),
    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')
    }
  },
}"><pre class="notranslate"><code class="notranslate">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')
    }
  },
}
</code></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
A clear and concise description of what you expected to happen (or code).</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.00</li>
<li>Node/npm version:  Node 8/npm 5]</li>
<li>OS: OSX 10.13.4</li>
<li>Monorepo: [e.g. yes/no/Lerna]</li>
<li>How you are using Babel: loader</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context/Screenshots</strong><br>
Add any other context about the problem here. If applicable, add screenshots to help explain.</p>
<blockquote>
<p dir="auto">Issue originally reported by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hzoo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hzoo">@hzoo</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="219374082" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/248" data-hovercard-type="issue" data-hovercard-url="/babel/babel-preset-env/issues/248/hovercard" href="https://github.com/babel/babel-preset-env/issues/248">babel/babel-preset-env#248</a></p>
</blockquote>
<p dir="auto">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.</p>
<p dir="auto">How can we write ES20xx and ship the smallest amount of code (for a given target environment)?</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> syntax: if your target environment supports that syntax, don't compile it (the original point of this project)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> polyfill: if your target environment supports that built-in, don't polyfill it (done in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="181806367" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/20" data-hovercard-type="issue" data-hovercard-url="/babel/babel-preset-env/issues/20/hovercard" href="https://github.com/babel/babel-preset-env/issues/20">babel/babel-preset-env#20</a> v1.0.0)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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) <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="218600722" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/241" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel-preset-env/pull/241/hovercard" href="https://github.com/babel/babel-preset-env/pull/241">babel/babel-preset-env#241</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> bundler: do polyfills need to be it's own chunk (webpack)?</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> babel helpers: reference the same helpers instead of recreating per file (either via <a href="https://github.com/babel/babel/tree/7.0/packages/babel-plugin-transform-runtime#options">https://github.com/babel/babel/tree/7.0/packages/babel-plugin-transform-runtime#options</a>) or (<a href="http://babeljs.io/docs/plugins/external-helpers" rel="nofollow">http://babeljs.io/docs/plugins/external-helpers</a>)
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="219340245" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/246" data-hovercard-type="issue" data-hovercard-url="/babel/babel-preset-env/issues/246/hovercard" href="https://github.com/babel/babel-preset-env/issues/246">babel/babel-preset-env#246</a> Move transform-runtime into this preset if a library (<code class="notranslate">type: "library"</code>)?</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="219371745" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/247" data-hovercard-type="issue" data-hovercard-url="/babel/babel-preset-env/issues/247/hovercard" href="https://github.com/babel/babel-preset-env/issues/247">babel/babel-preset-env#247</a> Move external-helpers into this preset if an application (<code class="notranslate">type: "app"</code>)?</li>
</ul>
</li>
</ul>