title: Provide npm packages as ES modules as-is
body: <p>I like to use some libraries provided as npm modules (with dependencies etc.) in a web page as ES modules that does not need a build system (eg. webpack) by itself.</p>
  <p>So I use npm and webpack to bundle these libraries into a ES module file, using package.json: &quot;type&quot;:&quot;module&quot; and an index.js like:</p>
  <pre><code>import * as _FOO  from 'foo';
  import {Bar as _Bar} from 'foo-bar-baz'
  
  export let FOO=_FOO;
  export let Bar=_Bar;
  </code></pre>
  <p>Then I import dist/main.js as ES6 module in my further code, providing all imports I need, with no need of building as far the dependencies don't change.</p>
  <p>However, it seems silly to take care of this index.js.
  So is there any way to just webpack all npm packages listed as project dependencies into an ES module with their native export names?</p>