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

187
Views
Can webpack automatically change href links in an HTML page?

I'm new to using webpack and right now I've just got a basic setup with an index.html page that has a reference to a test page like so: <a href="/test.html">license</a>

Right now, webpack is loading the index.html page into a dist folder using the HTMLWebpackPlugin, and my test.html file is staying in my src folder. What I want to achieve is for the test.html file to also be loaded into the dist folder, but for the href within the index.html file to automatically be updated. This is because when I'm using the HTMLWebpackPlugin, I am renaming the HTML files that go to the dist folder with names such as dist-index.html and dist-test.HTML for clarity. Is this possible?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you want to use multiple HTML pages with webpack you should use this code example:

plugins: [
  new HtmlWebpackPlugin({
    filename: 'index.html',
    template: 'src/index.html',
    chunks: ['main']
  }),
  new HtmlWebpackPlugin({
    filename: 'example.html',
    template: 'src/example.html',
    chunks: ['exampleEntry']
  })
]

Instead if you are using some libraries like React, you should install react-router-dom and use the default configuration.

about 4 years ago · Juan Pablo Isaza Report
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!