title: How to exclude core-js using useBuiltIns: "usage"
body: <p>Using babel 7.5.5, core-js 3.1.4 and webpack 4.38.0, how can I exclude core-js from transpiling?</p>
  
  <p><strong>I do not want to exclude <code>node_modules</code> altogether since I have libs that need transpiling</strong></p>
  
  <p>If I use <code>exclude: /node_modules\/(core-js)/</code>, a core-js module throws </p>
  
  <blockquote>
    <p>TypeError: $ is not a function</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/1w7SD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1w7SD.png" alt="devtools screenshot"></a></p>
  
  <p>This leaves me with two other options.</p>
  
  <ol>
  <li>Use includes instead, include my src directory and every dependency that needs transpiling one by one</li>
  <li>Use <code>useBuiltIns: entry</code> instead of usage, since in this case <code>exclude: /node_modules/\(core-js)/</code> works, and <code>import</code> core.js at the top of main.js</li>
  </ol>
  
  <p>Both of these options don't really seem like good solutions to me since <code>usage</code> is "no longer experimental" since 7.4.</p>
  
  <p>Is there any way to make it work using usage? Is it a bug in either babel-loader or babel? Or is my configuration at fault?</p>
  
  <p>This is my Webpack config:</p>
  
  <pre><code>const path = require('path');
  const webpack = require('webpack');
  
  module.exports = {
      mode: 'production',
      entry: {
          main: ['./src/main'],
      },
      output: {
          path: path.resolve(__dirname, './build/'),
          publicPath: '/build/'
      },
      module: {
          rules: [
              {
                  test: /\.js$/,
                  exclude: /node_modules\/(core-js)/,
  
                  use: {
                      loader: 'babel-loader'
                  },
              },
              {
                  test: require.resolve('jquery'),
                  use: [
                      {
                          loader: 'expose-loader',
                          options: 'jQuery'
                      },
                      {
                          loader: 'expose-loader',
                          options: '$'
                      }
                  ]
              }
          ]
      },
      plugins: [
          new webpack.ProvidePlugin({
              $: 'jquery',
              jQuery: 'jquery',
              'window.jQuery': 'jquery'
          })
      ],
  };
  </code></pre>
  
  <p>This is my babel config:</p>
  
  <pre><code>module.exports = function (api) {
      api.cache(true);
  
      return {
          presets: [
              [
                  '@babel/preset-env',
                  {
                      corejs: {
                          version: 3,
                      },
                      useBuiltIns: 'usage',
                  }
              ]
          ],
      };
  };
  </code></pre>
  
  <p>You can reproduce the error with the following repository: <a href="https://github.com/tomm1996/usebuiltins-exclude-test" rel="nofollow noreferrer">https://github.com/tomm1996/usebuiltins-exclude-test</a></p>