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