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 <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2022-11-16 12:06:08 +01:00
parent d97e4b5f7b
commit c8b99a8b74
+11 -2
View File
@@ -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"],
},
},
},
},
};