My project is vue project with vite and  when I run npm run build and I open /dist/index.html the page is not working.
I know that when I run npm run build && npm run preview it works. But I'm trying to make it work by only opening the index.html file. I need to embed the index.html file in my mobile app, so it should work by opening the index.html file only.
vite.config.js
import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { vueI18n } from "@intlify/vite-plugin-vue-i18n";
import checker from "vite-plugin-checker";
import { viteSingleFile } from "vite-plugin-singlefile"
export default defineConfig({
  plugins: [
    checker({ typescript: true }),
    vue(),
    viteSingleFile(),
    vueI18n({
      include: path.resolve(__dirname, "./src/locales/**"),
    }),
  ],
});
It seems like react+vite project with @vitejs/plugin-react-swc is working fine.