{"path":"apps/dashboard/vite.config.ts","size":1678,"locked":false,"binary":false,"truncated":false,"content":"import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\nimport tailwindcss from \"@tailwindcss/vite\";\nimport path from \"path\";\nimport { nodePolyfills } from \"vite-plugin-node-polyfills\";\n\nconst port = (() => {\n  const raw = process.env.PORT;\n  if (!raw) return 5173;\n  const parsed = Number(raw);\n  if (Number.isNaN(parsed) || parsed <= 0) return 5173;\n  return parsed;\n})();\n\nconst basePath = process.env.BASE_PATH ?? \"/\";\n\nexport default defineConfig({\n  base: basePath,\n  plugins: [\n    nodePolyfills({\n      globals: { Buffer: true, global: true, process: true },\n      protocolImports: true,\n    }),\n    react(),\n    tailwindcss(),\n  ],\n  resolve: {\n    alias: {\n      \"@\": path.resolve(import.meta.dirname, \"src\"),\n      \"vite-plugin-node-polyfills/shims/buffer\": path.resolve(\n        import.meta.dirname,\n        \"node_modules/vite-plugin-node-polyfills/shims/buffer\"\n      ),\n      \"vite-plugin-node-polyfills/shims/global\": path.resolve(\n        import.meta.dirname,\n        \"node_modules/vite-plugin-node-polyfills/shims/global\"\n      ),\n      \"vite-plugin-node-polyfills/shims/process\": path.resolve(\n        import.meta.dirname,\n        \"node_modules/vite-plugin-node-polyfills/shims/process\"\n      ),\n    },\n    dedupe: [\"react\", \"react-dom\", \"@solana/web3.js\", \"@coral-xyz/anchor\"],\n  },\n  root: path.resolve(import.meta.dirname),\n  build: {\n    outDir: path.resolve(import.meta.dirname, \"dist/public\"),\n    emptyOutDir: true,\n  },\n  server: {\n    port,\n    strictPort: false,\n    host: \"0.0.0.0\",\n    allowedHosts: true,\n    fs: {\n      strict: true,\n    },\n  },\n  preview: {\n    port,\n    host: \"0.0.0.0\",\n    allowedHosts: true,\n  },\n});\n"}