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

131
Views
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
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!