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/9515pull/883/MERGE
parent
17428e9867
commit
9552a3cd2e
|
|
@ -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]'
|
||||
|
|
|
|||
Loading…
Reference in New Issue