title: Project structure for a src to dist folder using node_modules
body: <p>I'm working on an project that makes use of npm's <code>node_modules</code>. In my case it's an Angular 2 project with Typescript, but I don't think that relevant.</p>
  
  <p>My project structure looks like this:</p>
  
  <pre><code>/
    dist/
      main.js
      index.html
    node_modules/
      ** all node modules
    src/
      main.ts
      index.html
  </code></pre>
  
  <p>The sources are in the <code>src</code> folder, and everything is automatically copied to the <code>dist</code> folder on save (Grunt tasks).</p>
  
  <p>The only problem is, how do I reference the <code>node_modules</code> from the <code>index.html</code> file?</p>
  
  <p>I could put a <code>../</code> in front of the path of every script that I reference in the <code>index.html</code>. But in a production environment the <code>index.html</code> will be in the root directory like the <code>node_modules</code> folder is. That means I have to update all the style and script references and remove the <code>../</code> infront of all paths.</p>
  
  <p>I have the feeling there is a better way to setup my work environment. I couldn't find any pleasing examples. </p>
  
  <p>How do other projects do this? Is there some sort of a uniform standard that seems to work well?</p>