Skip to content
Discussion options

You must be logged in to vote

After investigation, I ended up defining them in src/locales and using vite-plugin-static-copy and defining the following rule in vite.config.js:

export default defineConfig({
  plugins: [
    viteStaticCopy({
      targets: [
        {
          src: "src/locales",
          dest: "./", // copied to dist/locales/
        },
      ],
    }),
/* ... */
  ],
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
/* ... */

This copies them from src/locales to dist/locales and that is where the i18n backend expects them by default.

Accordingly, I updated my imports as follows (where @ is the alias to src):

import common from "@/locales/en-GB/common.json";
import login from

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by moebiuscorzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant