From 9552a3cd2e797dcdfea436f22d790eb2982d4442 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Mon, 15 Jun 2026 23:04:13 +0800 Subject: [PATCH] fix: remove @intlify/unplugin-vue-i18n to resolve ReferenceError The plugin forces vue-i18n to use esm-bundler.js entry via resolve alias, which contains esbuild/rolldown internal module init function references (init_runtime_dom_esm_bundler, etc.). When the bundler splits code into chunks, these cross-chunk references become orphaned, causing ReferenceError. Removing the plugin lets vue-i18n use its standard .mjs entry, which does not have these problematic references. Locale messages are then compiled at runtime instead of build time, but functionality is unchanged. Fixes #230 See https://github.com/rolldown/rolldown/issues/9515 --- build/vite/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build/vite/index.ts b/build/vite/index.ts index 5d2c477b3..1aacd2864 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -11,7 +11,6 @@ import Components from 'unplugin-vue-components/vite' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import viteCompression from 'vite-plugin-compression' import topLevelAwait from 'vite-plugin-top-level-await' -import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons-ng' import UnoCSS from 'unocss/vite' @@ -68,11 +67,7 @@ export function createVitePlugins() { cache: false, include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件 }), - VueI18nPlugin({ - runtimeOnly: true, - compositionOnly: true, - include: [resolve(__dirname, 'src/locales/**')] - }), + createSvgIconsPlugin({ iconDirs: [pathResolve('src/assets/svgs')], symbolId: 'icon-[dir]-[name]'