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

304
Vistas
How to decrease the directory hierarchy of the output of html files in Vite.js?

I have built an MPA project based on vite. And I put the templates in src/pages/. When I run dev or build, it will output something like /pages/list/index.html.But I don‘t need the router pages. How can I get the output like /pages/list/index.html?

The vite.config.ts is like below,

const root = path.resolve(__dirname, 'src');
const pageDir = path.resolve(root, 'pages')
const outDir = path.resolve(__dirname, 'dist');
    export default defineConfig({
      root,
      plugins: [
        react(),
        copy({
          targets: [{ src: 'src/lib/**/*', dest: 'dist/lib' }],
          hook: 'writeBundle'
        }),
      ],
      build: {
        outDir,
        emptyOutDir: true,
        rollupOptions: {
          input: {
            list:   path.resolve(pageDir, 'list/index.html'),
            filter: path.resolve(pageDir, 'filter/index.html'),
            result: path.resolve(pageDir, 'result/index.html'),
            search: path.resolve(pageDir, 'search/index.html'),
          }
        },
      },
      resolve: {
        alias: [
          {
            find: /@\//,
            replacement: path.join(__dirname, './src/')
          }
        ]
      },
      css: {
        "preprocessorOptions": {
          "less": {
            "javascriptEnabled": true
          }
        },
        "modules": {
          "localsConvention": "camelCase"
        }
      }
    })

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