title: Webpack output file to have exports default instead of module.exports
body: <p>I have a case where I need webpack to create a file using <code>export</code> syntax and not <code>module.exports</code>. Is this possible?</p>
  
  <p>Here's my config:</p>
  
  <pre><code>const path = require('path');
  
  module.exports = {
    mode: "production",
    entry: "./node/example.js",
    node: {
      console: true,
      global: true,
      process: true,
      __filename: true,
      __dirname: true,
      Buffer: true,
      setImmediate: true,
    },
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: 'example.js',
      libraryTarget: 'commonjs-module'
    },
    resolve: {
      // options for resolving module requests
      // (does not apply to resolving to loaders)
      modules: [
        "node_modules",
        path.resolve(__dirname, "app")
      ],
      // directories where to look for modules
      extensions: [".js", ".ts", ".jsx", ".css"],
    },
  
    target: "node", // enum  // the environment in which the bundle should run
  
  }
  </code></pre>
  
  <blockquote>
    <p>example.js looks like this:</p>
  </blockquote>
  
  <pre><code>module.exports = function() {
    return 'hello world';
  }
  </code></pre>
  
  <p>What I need webpack to do is export with <code>export default</code> rather then <code>module.exports =</code>.</p>