1

Hello guys i have a project in vue 3 cli and i work with i18n everything works fine in dev, but i18n not working in prod and i also get a warn in dev like this: You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.

main.js `

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import { languages } from './i18n'
import { defaultLocale } from './i18n'
import { createI18n, useI18n } from 'vue-i18n'

const messages = Object.assign(languages)

const i18n = createI18n({
    legacy: false,
    locale: defaultLocale,
    fallbackLocale: 'en',
    messages,
})

createApp(App, {
    setup() {
        const { t } = useI18n()
        return { t }
    },
})
    .use(i18n)
    .use(createPinia())
    .use(router)
    .mount('#app')

`

vue.config `

const { defineConfig } = require('@vue/cli-service')


module.exports = defineConfig({
    transpileDependencies: true,

})

`

how can i solve this problem?

  • Does this answer your question? [You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with](https://stackoverflow.com/questions/66140411/you-are-running-the-esm-bundler-build-of-vue-i18n-it-is-recommended-to-configur) – Lee Goddard Mar 09 '23 at 08:32

0 Answers0