codex-marketplace-ui/vite.config.ts

50 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2024-08-22 15:41:44 +00:00
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
2024-09-26 17:44:35 +00:00
import packageJson from "./package.json";
2024-11-06 20:11:50 +00:00
import svgr from "vite-plugin-svgr";
2024-08-22 15:41:44 +00:00
// https://vitejs.dev/config/
export default defineConfig({
2024-11-06 20:11:50 +00:00
plugins: [TanStackRouterVite(), react(), svgr({
svgrOptions: {
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
svgoConfig: {
floatPrecision: 2,
},
},
// ...
})],
2024-09-26 15:21:29 +00:00
define: {
2024-09-26 17:44:35 +00:00
"import.meta.env.PACKAGE_VERSION": JSON.stringify(packageJson.version),
2024-09-26 15:21:29 +00:00
},
2024-08-30 18:17:57 +00:00
build: {
sourcemap: true,
2024-09-13 21:09:12 +00:00
rollupOptions: {
output: {
manualChunks: {
"@sentry/react": ["@sentry/react"],
2024-11-01 14:07:30 +00:00
"emoji-picker-react": ["emoji-picker-react"],
"dotted-map": ["dotted-map"],
2024-11-01 14:33:23 +00:00
"echarts": ["echarts"],
}
},
2024-09-13 21:09:12 +00:00
onwarn(warning, defaultHandler) {
if (warning.code === "SOURCEMAP_ERROR") {
return;
}
defaultHandler(warning);
},
},
2024-08-30 18:17:57 +00:00
},
resolve: {
alias: {
"../sdk/codex": "../proxy",
"../../sdk/codex": "../../proxy",
2024-11-01 19:23:47 +00:00
"./port-forwarding.util": "../proxy",
},
},
2024-08-22 15:41:44 +00:00
});