50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
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";
|
|
import { i18nextVitePlugin } from "@i18next-selector/vite-plugin";
|
|
import i18nextConfig, {
|
|
DEFAULT_LANGUAGE,
|
|
LOCALES_PATH,
|
|
LOCAL_LOCALES_PATH,
|
|
} from "./i18next.config";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
i18nextVitePlugin({
|
|
sourceDir: LOCAL_LOCALES_PATH,
|
|
}),
|
|
tanstackDevtools({
|
|
removeDevtoolsOnBuild: true,
|
|
logging: true,
|
|
injectSource: {
|
|
enabled: true,
|
|
},
|
|
editor: {
|
|
name: "WebStorm",
|
|
open: async (path, lineNumber, columnNumber) => {
|
|
const { exec } = await import("node:child_process");
|
|
exec(
|
|
`webstorm -g "${path.replaceAll("$", "\\$")}${lineNumber ? `:${lineNumber}` : ""}${columnNumber ? `:${columnNumber}` : ""}"`,
|
|
);
|
|
},
|
|
},
|
|
enhancedLogs: {
|
|
enabled: true,
|
|
},
|
|
}),
|
|
tanstackRouter({
|
|
target: "react",
|
|
autoCodeSplitting: true,
|
|
}),
|
|
react(),
|
|
tailwindcss(),
|
|
],
|
|
define: {
|
|
__LANGS__: JSON.stringify(i18nextConfig.locales),
|
|
__LOCALES_PATH__: JSON.stringify(LOCALES_PATH),
|
|
__DEFAULT_LANG__: JSON.stringify(DEFAULT_LANGUAGE),
|
|
},
|
|
});
|