title: How to create a library that can have individual components imported if required à la lodash
body: <p>I've written a library in es6 using import/export. I can bundle this library using Rollup into a IIFE that can be used in the browser.</p>
  
  <p>I also want to be able to use this library in other projects. However, I won't usually want to include the whole library, only parts of it.</p>
  
  <p>Because the library is written using es6 import/export I can include the unbundled index.js file as a dependency in another project and then <code>import { myFunc } from 'my-lib'</code> and this works great - I only get myFunc when my project is bundled.</p>
  
  <p>However, I ran into an issue because these files haven't been processed by babel and therefore contain es6 code such as arrow functions. I have read that if you're going to publish a library it shouldn't need to be transpiled by the end-user.</p>
  
  <p>How can I take my es6 library and bundle it in such a way that it is transpiled, but also able to have its individual components imported? I want a similar situation to how lodash is organised.</p>
  
  <p>This isn't the easiest thing to articulate so if anything isn't clear please leave a comment and I'll edit my question to try and clarify.</p>