How to set vite config to remove index file sunbfolder while mutlple entry point

39 Views Asked by At

I am using vite with vuejs i have multiple entry points my issue I am getting a extra subfolder as login like below (my current folder structure).

├─ my-app/ │ ├─ dist ├─ login ├─ login ├─index.html

Actually I want like this,

├─ my-app/ │ ├─ dist ├─ login ├─index.html

Below is the code in vite.config.login.ts,

    import { resolve } from 'path';
    import { defineConfig } from 'vite';
    import Vue from '@vitejs/plugin-vue';
    import VueRouter from 'unplugin-vue-router/vite';
    export default defineConfig({
      base: '/', // Set the base path for assets
      plugins: [Vue(), VueRouter()],
      build: {
        outDir: 'dist/login',
        rollupOptions: {
          input: resolve("./login/index.html", ""),
    },
  },
});
1

There are 1 best solutions below

0
On

for outDir you can have dist instead of dist/login