title: Webpack config for simple js with imports
body: <p>./src/foo.js</p>
  <pre><code>const foo = (foo) =&gt; {
    console.log(`foo: ${foo}`);
  }
  
  export default foo;
  </code></pre>
  <p>./src/bar.js</p>
  <pre><code>import foo from './foo';
  
  const bar = (bar) =&gt; {
    foo(bar);
    console.log(`bar: ${bar}`);
  }
  
  export default bar;
  </code></pre>
  <p>./src/index.ts</p>
  <pre><code>import foo from './foo';
  import bar from './bar';
  
  if (test === 'foo') {
    foo('test === foo');
  }
  if (test === 'bar') {
    bar('test === bar');
  }
  
  </code></pre>
  <p>With simple rollup config (just set input and output) I get what i want (simple clear bundled js)</p>
  <pre><code>const foo = (foo) =&gt; {
    console.log(`foo: ${foo}`);
  };
  
  const bar = (bar) =&gt; {
    foo(bar);
    console.log(`bar: ${bar}`);
  };
  
  if (test === 'foo') {
    foo('test === foo');
  }
  if (test === 'bar') {
    bar('test === bar');
  }
  </code></pre>
  <p>Can I have something like this via webpack? The closest I got is this config</p>
  <pre><code>const path = require('path');
  
  module.exports = {
    mode: 'production',
    output: {
      filename: 'bundle.js',
      path: path.resolve(__dirname, 'webpackdist'),
      iife: false,
    },
    optimization: {
      minimize: false,
    },
  }
  </code></pre>
  <p>That produces this bundled js</p>
  <pre><code>/******/ &quot;use strict&quot;;
  var __webpack_exports__ = {};
  
  ;// CONCATENATED MODULE: ./src/foo.js
  const foo = (foo) =&gt; {
    console.log(`foo: ${foo}`);
  }
  
  /* harmony default export */ const src_foo = (foo);
  
  ;// CONCATENATED MODULE: ./src/bar.js
  
  
  const bar = (bar) =&gt; {
    src_foo(bar);
    console.log(`bar: ${bar}`);
  }
  
  /* harmony default export */ const src_bar = (bar);
  
  ;// CONCATENATED MODULE: ./src/index.js
  
  
  
  if (test === 'foo') {
    src_foo('test === foo');
  }
  if (test === 'bar') {
    src_bar('test === bar');
  }
  </code></pre>
  <p>But i dont want</p>
  <ul>
  <li>webpack comments (but leave comments from source files)</li>
  <li>src_foo/src_bar</li>
  <li><code>__webpack_exports__</code></li>
  </ul>