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

27 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 answers

0
Abdullah Sohail On

for outDir you can have dist instead of dist/login