title: ERROR from UglifyJs Webpack plugin - Unexpected token: name (extends)
body: <p>I am trying to minify my project with Uglifyjs, but I get an error Unexpected token: name (extends). The problem seems to be connected to transpiling, but I am already using babel for that. For reference, you can access the project with reproduced bug from my <a href="https://github.com/skukan159/DebuggingPolymerWebpack" rel="nofollow noreferrer">repository</a>. Otherwise, here is also a snippet of my webpack configuration and my .babelrc file : </p>
  
  <pre><code>const webpack = require('webpack');
  const path = require('path');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const WorkboxPlugin = require('workbox-webpack-plugin');
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); 
  
  const webcomponentsjs = './node_modules/@webcomponents/webcomponentsjs';
  
  const polyfills = [
      //Webcomponents polyfill applied in the index.html
      {
          from: path.resolve(`${webcomponentsjs}/webcomponents-*.{js,map}`),
          to: path.join(__dirname, 'wwwroot'),
          flatten: true
      },
  
          {
              from: path.resolve(`${webcomponentsjs}/custom-elements-es5-adapter.js`),
              to: path.join(__dirname, 'wwwroot'),
              flatten: true
          },
  ];
  
  module.exports = function (env) {
      return {
          mode: 'development',
          devtool: 'inline-source-map',
          entry: './src/index.js',
          output: {
              publicPath: '/',
              path: path.resolve(__dirname, 'wwwroot'),
              filename: "[name].[contenthash].js",  
              chunkFilename: '[name].[contenthash].js',
          },
  
          optimization: {
              splitChunks: {
                  cacheGroups: {
                      vendor: {
                         test: /[\\/]node_modules[\\/]/,
                         name: 'vendors',
                         chunks: 'all'
                      }
                  }
              },
              runtimeChunk: 'single',
              minimize: true,
              minimizer: [
                   new UglifyJsPlugin()
               ],
               usedExports: true,
               sideEffects: false
          },
  
          module: {
              rules: [
                  {
                      test: /\.js$/,
                     //exclude: /node_modules/,
                      use: {
                          loader: 'babel-loader',  
                      }
                  },
                  {
                      "test": /\.html$/,
                      "use": [{
                          loader: 'html-loader',
                      }]
                  }
              ]
          },
  
          resolve: {
              modules: [
                  "node_modules",
                  path.resolve(__dirname, "src")
              ],
              extensions: [".js", ".json"],
          },
  
          plugins: [
              new webpack.HashedModuleIdsPlugin(),
              new HtmlWebpackPlugin({
                  template: 'src/index.html'}),
              new CleanWebpackPlugin(['wwwroot']),
              new CopyWebpackPlugin([...polyfills]),
          ],
  
      }
  };
  </code></pre>
  
  <p>And here is my .babelrc file: </p>
  
  <pre><code>{
      "presets": [
          [
          "@babel/preset-env",
          {
              "targets": {
              "browsers": [ "last 2 versions", "ie &gt;= 11" ]
              },
              "exclude": [ "transform-classes" ]
          }
          ]
      ],
      "plugins": [
          "@babel/plugin-proposal-class-properties",
          "@babel/plugin-proposal-object-rest-spread",
          "@babel/plugin-syntax-dynamic-import"
      ]
  }
  </code></pre>