Skip to content

Commit

Permalink
Fix config for building ¯\_(ツ)_/¯
Browse files Browse the repository at this point in the history
  • Loading branch information
vrde committed Mar 11, 2022
1 parent ee1a7d8 commit 2500dfe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@tsconfig/svelte": "^3.0.0",
"@walletconnect/web3-provider": "^1.7.4",
"ethers": "^5.6.0",
"rollup-plugin-polyfill-node": "^0.8.0",
"svelte": "^3.46.4",
"svelte-check": "^2.4.5",
"svelte-preprocess": "^4.10.4",
Expand All @@ -25,4 +26,4 @@
"vite": "^2.8.6",
"web3modal": "^1.9.5"
}
}
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@ import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import inject from "@rollup/plugin-inject";
import nodePolyfills from "rollup-plugin-polyfill-node";

// https://vitejs.dev/config/
export default defineConfig({
base: "./",
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
plugins: [
svelte(),
inject({
util: "util/",
}),
],
build: {
rollupOptions: {
plugins: [nodePolyfills()],
},
commonjsOptions: {
transformMixedEsModules: true,
},
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
Expand Down

0 comments on commit 2500dfe

Please sign in to comment.