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

269
Visualizações
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 à 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