2026-03-16 00:50:53 +02:00
|
|
|
import path from "node:path";
|
|
|
|
|
|
2026-03-08 23:30:37 +00:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import react from "@vitejs/plugin-react-swc";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
|
import tanstackRouter from "@tanstack/router-plugin/vite";
|
|
|
|
|
import { devtools as tanstackDevtools } from "@tanstack/devtools-vite";
|
2026-03-22 04:08:56 +02:00
|
|
|
import { i18nextSortPlugin } from "./plugins/i18nextSortPlugin";
|
|
|
|
|
import { i18nextTypesPlugin } from "./plugins/i18nextTypesPlugin";
|
2026-03-10 03:05:06 +02:00
|
|
|
import i18nextConfig, {
|
|
|
|
|
DEFAULT_LANGUAGE,
|
|
|
|
|
LOCALES_PATH,
|
|
|
|
|
LOCAL_LOCALES_PATH,
|
|
|
|
|
} from "./i18next.config";
|
2026-03-07 21:44:42 +02:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-03-08 23:30:37 +00:00
|
|
|
plugins: [
|
2026-03-22 04:08:56 +02:00
|
|
|
i18nextSortPlugin({
|
2026-03-10 03:05:06 +02:00
|
|
|
sourceDir: LOCAL_LOCALES_PATH,
|
|
|
|
|
}),
|
2026-03-22 04:08:56 +02:00
|
|
|
i18nextTypesPlugin({
|
|
|
|
|
sourceDir: LOCAL_LOCALES_PATH,
|
|
|
|
|
destination: "./src/i18n/resources.d.ts",
|
|
|
|
|
}),
|
2026-03-08 23:30:37 +00:00
|
|
|
tanstackDevtools({
|
|
|
|
|
removeDevtoolsOnBuild: true,
|
|
|
|
|
}),
|
|
|
|
|
tanstackRouter({
|
|
|
|
|
target: "react",
|
|
|
|
|
autoCodeSplitting: true,
|
|
|
|
|
}),
|
|
|
|
|
react(),
|
|
|
|
|
tailwindcss(),
|
|
|
|
|
],
|
2026-03-10 03:05:06 +02:00
|
|
|
define: {
|
|
|
|
|
__LANGS__: JSON.stringify(i18nextConfig.locales),
|
|
|
|
|
__LOCALES_PATH__: JSON.stringify(LOCALES_PATH),
|
|
|
|
|
__DEFAULT_LANG__: JSON.stringify(DEFAULT_LANGUAGE),
|
|
|
|
|
},
|
2026-03-12 00:42:41 +02:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
"@": path.resolve(__dirname, "./src"),
|
|
|
|
|
"@components": path.resolve(__dirname, "./src/components"),
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-03-08 23:30:37 +00:00
|
|
|
});
|