admin管理员组文章数量:1321062
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.
本文标签: vuejsI got blank page when opening indexhtmlStack Overflow
版权声明:本文标题:vue.js - I got blank page when opening index.html - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742092376a2420344.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论