title: How to create symlinks with gulp and keep files relative
body: <p>Suppose I have a folder structure like this:</p>
  <pre><code>packages
  ├── project1
  │   └── src
  │       └── index.js
  ├── project2
  │   └── src
  │       └── index.js
  └── project3
      └── src
  │       └── index.js
  </code></pre>
  <p>In each of the projects, i would like to create a dist folder with symlinks relative to the <code>index.js</code> from src, so that it would look like this:</p>
  <pre><code>packages
  ├── project1
  │   ├── src
  │   │    └── index.js
  │   └── dist
  │       └── index.js (symlink to ../src/index.js)
  ├── project2
  │   ├── src
  │   │    └── index.js
  │   └── dist
  │       └── index.js (symlink to ../src/index.js)
  └── project3
      ├── src
      │    └── index.js
      └── dist
          └── index.js (symlink to ../src/index.js)
  </code></pre>
  <p>How can this be achieved with gulp? This is my starting point:</p>
  <pre><code>gulp.task(&quot;symlink&quot;, () =&gt; {
    return gulp.src(&quot;packages/*/src/index.js&quot;).pipe(gulp.symlink(&quot;./packages/dist&quot;))
  });
  </code></pre>
  <p>But this does obviously not work, it creates the files at for example <code>packages/dist/project1/src/index.js</code>. What do I need to change in order to get to the desired outcome, placing the files relative inside each project's dist folder?</p>