Try the below for your Vite config - removing outDir
and root
altogether. root
defaults to the current directory and outDir
is relative to root
. So without setting them explicitly, the dist
folder should get created in your project root folder and Capacitor should find it when webDir
is set to dist
.
import { defineConfig } from 'vite'
export default defineConfig({
server: {
port: 3000, // Puerto para el servidor de desarrollo
},
})
EDIT
This assumes your index.html
is in the root folder of your project as well which is the standard for Vite.