Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
How to create symlinks with gulp and keep files relative

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!