title: Babel Plugin/Preset files are not allowed to export objects, only functions
body: <p>I`m tryng to use Babel-loader on an old project, and i notice some issues regarding when babel loader is working on wrapped objects, is this its default behaviour ? I am not sure if this is a bug or something im doing wrong, i could not find much about it over google, so this is my last resource.</p>
  
  <p>Would i need to change something to my code to make it work ?</p>
  
  <p>This are my current specs:
   Webpack: 3.19.0
   babel/core: 7.0.0-beta.34
   babel-loader: 8.0.0-beta.0</p>
  
  <p>Please refer to my packages.json if needed:</p>
  
  <p><a href="http://paste.ubuntu.com/26187880/" rel="noreferrer">http://paste.ubuntu.com/26187880/</a></p>
  
  <p>I`m tryng to load a single file wrapped in a function:</p>
  
  <p><a href="http://paste.ubuntu.com/26187814/" rel="noreferrer">http://paste.ubuntu.com/26187814/</a></p>
  
  <p>Resuming, something old, that is built like this:</p>
  
  <pre><code>(  window.global = { } )();
  </code></pre>
  
  <p>This is my webpack config:</p>
  
  <pre><code>const webpackConfig = {
      context: __dirname,
      entry: {
          app: '../../JavaScript/Namespacing.js'
      },
      module: {
          rules: [
            {
              test: /.jsx?$/,
              exclude: /(node_modules|bower_components)/,
              use: {
                loader: 'babel-loader',
              }
            }
          ]
      },
      output: {
        path: __dirname + "/../../static/js",
        filename: "[name].js"
      },
      plugins: [
          new webpack.ProvidePlugin({
              $: "jquery",
              jQuery: "jquery",
              "window.jQuery": "jquery"
          })
      ],
  }
  </code></pre>
  
  <p>And the error i get on my file is the following:</p>
  
  <p><code>Plugin/Preset files are not allowed to export objects, only functions.</code></p>
  
  <p>So, am i missing something ? </p>
  
  <p>Thanks for any help.</p>