diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 17:51:24 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 17:51:24 -0800 |
| commit | 13466248004327e9a026cb89f94926f9b060d1c1 (patch) | |
| tree | 47b4972c33809ccdf866b043c92cd3e0ecf5dcd0 /vite.config.js | |
| parent | 3aa9ce1b5985397d7f568887ec6f881df13c1034 (diff) | |
| download | coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.tar.gz coinos-ui-13466248004327e9a026cb89f94926f9b060d1c1.zip | |
linting
Diffstat (limited to 'vite.config.js')
| -rw-r--r-- | vite.config.js | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/vite.config.js b/vite.config.js index 1d4fe742..1ab49ed2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,57 +4,59 @@ import { visualizer } from "rollup-plugin-visualizer"; import { defineConfig, loadEnv } from "vite"; export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ""); - const analyze = process.env.ANALYZE === "true"; + const env = loadEnv(mode, process.cwd(), ""); + const analyze = process.env.ANALYZE === "true"; - return { - plugins: [ - tailwindcss({ optimize: false }), - sveltekit(), - analyze && - visualizer({ - filename: "build/stats.html", - gzipSize: true, - brotliSize: true, - template: "treemap", - }), - ].filter(Boolean), - css: { - transformer: "postcss", - }, - preview: { - allowedHosts: [ - process.env.PUBLIC_DOMAIN || env.PUBLIC_DOMAIN || "coinos.io", - ...((process.env.PUBLIC_EXTRA_HOSTS || env.PUBLIC_EXTRA_HOSTS || "").split(",").filter(Boolean)), - ], - }, - server: { - proxy: - process.env.NODE_ENV === "development" - ? { - "/api/": { - target: "http://localhost:3119", - rewrite: (path) => path.replace(/^\/api\//, ""), - }, - } - : undefined, - }, - build: { - cssMinify: "esbuild", - chunkSizeWarningLimit: 1000, - rollupOptions: { - output: { - manualChunks(id) { - if (id.includes("node_modules")) { - const parts = id.split("node_modules/")[1].split("/"); - const pkg = parts[0].startsWith("@") - ? `${parts[0].slice(1)}-${parts[1]}` - : parts[0]; - return `vendor-${pkg}`; - } - }, - }, - }, - }, - }; + return { + plugins: [ + tailwindcss({ optimize: false }), + sveltekit(), + analyze && + visualizer({ + filename: "build/stats.html", + gzipSize: true, + brotliSize: true, + template: "treemap", + }), + ].filter(Boolean), + css: { + transformer: "postcss", + }, + preview: { + allowedHosts: [ + process.env.PUBLIC_DOMAIN || env.PUBLIC_DOMAIN || "coinos.io", + ...(process.env.PUBLIC_EXTRA_HOSTS || env.PUBLIC_EXTRA_HOSTS || "") + .split(",") + .filter(Boolean), + ], + }, + server: { + proxy: + process.env.NODE_ENV === "development" + ? { + "/api/": { + target: "http://localhost:3119", + rewrite: (path) => path.replace(/^\/api\//, ""), + }, + } + : undefined, + }, + build: { + cssMinify: "esbuild", + chunkSizeWarningLimit: 1000, + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes("node_modules")) { + const parts = id.split("node_modules/")[1].split("/"); + const pkg = parts[0].startsWith("@") + ? `${parts[0].slice(1)}-${parts[1]}` + : parts[0]; + return `vendor-${pkg}`; + } + }, + }, + }, + }, + }; }); |
