In my package.json file I have "@nuxtjs/i18n": "^8.0.0-rc.5" installed
I have the following code in the nuxt.config.ts file
modules: ["@nuxtjs/i18n"],
build: {
transpile: ["vue-i18n"],
},
i18n: {
vueI18n: "./i18n.config.ts",
},
vite: {
plugins: [
VueI18nVitePlugin({
include: [
resolve(dirname(fileURLToPath(import.meta.url)), "./locales/*.json"),
],
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: "@use \"@/assets/styles/_variables.scss\" as *;",
},
},
},
},
When running npm run dev command, everything works totally fine.
However, when I run npm run build or npm run preview commands, the build finishes without errors, but when I open it up, I see the error related to the i18n module.
production build error
npm run build result in terminal
The content of the i18n.config.ts file:
import ru from "~/locales/ru.json"
import en from "~/locales/en.json"
export default defineI18nConfig(() => ({
legacy: false,
globalInjection: true,
locale: "ru",
messages: {
ru,
en,
},
}))