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

270
Views
Build several index.html files (one per language) from a common template?

I have a React app where I need to internationalise the open graph meta properties and title, description and noscript tags in index.html. For an open graph crawler like the one they use on slack, facebook, linkedIn etc. to see these, the server needs to supply an index.html where all of these properties are set to the correct internationalised string when the client accesses the link. So using a client based framework like Helmet is out of the question.

  1. Goal 1: I would like Vite to use a common template to produce three versions of index.html: one for each language. Each index_lng.html should use the same javascript bundle.

I have looked into writing my own Vite plugin for this, but it seems I can only do a 1 to 1 mapping of my index.html template.

  1. Goal 2: I would also like to configure the dev server to serve the correct index_lng.html file based on a query parameter in the URL. So if I send someone a link to myapp.com?lng=de, the dev server should respond with index_de.html.

Is it possible to achieve these two things with Vite? Any pointers would be very appreciated.

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