title: NPM package: best practices and exposing multiple import paths
body: <p>I created an NPM package that uses Webpack and Babel for transpiling/bundling.</p>
  
  <p>In my <code>package.json</code>, I've got main set to <code>"main": "build/index.js"</code>. And in my Webpack config, I have entry set to <code>entry: { app: './src/index.js' }</code>. My entry file is shown below.</p>
  
  <p>Everything works fine when the package is installed. However, with this setup, two import paths are exposed for every helper:</p>
  
  <p>This is a problem for editors that support auto imports, since they will sometimes auto import from <code>'my-package/build/utils/helper1'</code> rather than the preferred path of <code>'my-package'</code>.</p>
  
  <p><strong>So, two questions:</strong></p>
  
  <ol>
  <li>Is there any way to prevent the longer import path from being exposed?</li>
  <li>What is considered best practice when creating NPM packages. Is my setup acceptable, or should I be doing something different?</li>
  </ol>
  
  <p><strong>Entry File:</strong></p>
  
  <pre><code>import helper1 from './utils/helper1';
  import helper2 from './utils/helper2';
  
  export {
    helper1,
    helper2,
  };
  
  const myPackage = {
    helper1,
    helper2,
  };
  
  export default myPackage;
  </code></pre>