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

170
Vistas
How to add a public directory in vitejs configuration file

I have a folder (named assets) with pictures, pdf files and 3d models that I want to include in the public static path at dist directory after building with Vite.js.

I am using this code for the vite.config.js:

  export default {
    pulicDir: './assets'
  }

However after building, the files are not copied to de dist folder. When I run vite serve the website works, but I get "not found error" for all the files that should've been in that public folder. Thanks a lot for the help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Not sure why, but the problem was solved with this code at vite.config.js

module.exports = {     
    root: './',     
    build: {       
       outDir: 'dist',
            },     
    publicDir: 'assets'   
 } 
about 4 years ago · Juan Pablo Isaza Denunciar
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