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

132
Vistas
How do I change the relative paths of my assets ( css, images, js) in index.html while copying the index.html from `src` do `dist` using gulp?

I'm new to gulp. So, I was trying to do the regular stuff - css, js minification and image optimization using gulp. I did achieve the desired output. Now I am wondering what If I don't have to change the paths of the assets(css, js, images) in my index.html file manually and it works perfectly when placed/copied inside the dist folder using gulp? So how can I achieve that??

For example- ../dist/css/style.css in src index.html becomes css/style.css in dist index.html file and <img src="../dist/img/pic.webp" > becomes <img src="img/pic.webp" >

project
    |-dist
        |-css
        |-img
        |-js
        index.html
    |-src
        |-scss
        |-img
        |-js
        index.html
    gulp.js
    ...

Here's the code for copying the htmls from src to dist:

function copyHtml() {
    return gulp.src('src/*.html')
        .pipe(gulp.dest('dist'));

}
about 4 years ago · Santiago Gelvez
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