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

272
Vistas
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
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