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

291
Views
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
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!