From c8b99a8b7434bfb91fdcb88a645061fbaa9a5b3e Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 16 Nov 2022 11:30:12 +0100 Subject: [PATCH] Removes `compilerOptions` and chunk size warnings We split some third party packages into their own bundles to reduce the size of the index.js bundle. We also don't need hmr ever in production. Signed-off-by: Sebastian Martinez --- vite.config.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 07d90d224..759a88093 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,6 @@ const config: UserConfig = { }, plugins: [ svelte({ - hot: !process.env.VITEST, compilerOptions: { dev: process.env.NODE_ENV !== "production", }, @@ -47,7 +46,17 @@ const config: UserConfig = { }, build: { outDir: "build", - sourcemap: true, + rollupOptions: { + output: { + manualChunks: { + ethers: ["ethers", "@ethersproject/abstract-provider"], + auth: ["siwe", "@walletconnect/client"], + cache: ["lru-cache", "@stardazed/streams"], + markdown: ["katex", "dompurify", "marked", "@radicle/gray-matter"], + dom: ["svelte", "pure-svg-code", "twemoji"], + }, + }, + }, }, };