最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vue.js - I got blank page when opening index.html - Stack Overflow

programmeradmin3浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论