Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda