Open terion-name opened 2 years ago
I've been working on something called Vista and it sets runtimeOnly
to false. It's a module for Nuxt 3 and it has this code in it to set the value:
extendViteConfig((config) => {
const i = config.plugins.findIndex((value) => (value as Record<string, any>).name === 'vite-plugin-vue-i18n')
if (i === -1) throw new Error('[vista] requires @intlify/nuxt3, please load it before vista')
const viteOptions = {
compositionOnly: false,
runtimeOnly: false
}
if (hasLocaleFiles) {
viteOptions['include'] = resolve(localeDir, './**')
}
config.plugins[i] = vueI18n(viteOptions)
})
https://github.com/intlify/nuxt3/issues/39#issuecomment-1114544562 I have found a solution
readme at https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n states that for build you need to set the runtimeOnly option to false.
but how to set it in Nuxt3? build fails with
messageCompiler is not a function
such things don't work:
(in fact these options are completely ignored because setting there non-existent files doesn't break build)
UPD looking at callstack, it is error in compileMessageFormat func, that is part of @intlify/core-base
aliasing it also doesn't work: