Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda