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

534
Views
Multiple Inputs with Vite

I'm having multiple inputs when building my app with vite. My config looks like this:

export default defineConfig({
  plugins: [
    react(),
    eslintPlugin()
  ],
  build: {
    rollupOptions: {
      input: {
        test1: resolve(__dirname, '/test1.html'),
        test2: resolve(__dirname, '/test2.html')
      }
    }
  }
});

The output looks like this:

dist
|-test1.html
|-test2.html
|-assets

What I actually want is something like this:

dist
|test1
  |-index.html
|test2
  |-index.html
|-assets

Is this possible?

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The build output normally matches the directory structure of the input file, so in your case, you could move those files into the respective directories under the project root directory:

my-project/
 |- test1/
 | `- index.html
 `- test2/
   `- index.html

Then configure Vite's build.rollupOptions.input to point to those files:

// vite.config.js
import { defineConfig } from 'vite'
import { resolve } from 'path'

export default defineConfig({
  ⋮
  build: {
    rollupOptions: {
      input: {
        test1: resolve(__dirname, './test1/index.html'),
        test2: resolve(__dirname, './test2/index.html'),
      },
    },
  },
})

demo

about 4 years ago · Juan Pablo Isaza Report
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!