Skip to content

Commit

Permalink
examples/wagmi: added visualizer to output
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Mar 23, 2024
1 parent 72ed436 commit 195e537
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 72 deletions.
2 changes: 2 additions & 0 deletions examples/wagmi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

stats.html

node_modules
dist
dist-ssr
Expand Down
13 changes: 7 additions & 6 deletions examples/wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
"dependencies": {
"@oasisprotocol/sapphire-wagmi": "workspace:^",
"@tanstack/react-query": "5.0.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "latest",
"wagmi": "latest",
"start-server-and-test": "^2.0.0"
"react": ">=18",
"react-dom": ">=18",
"start-server-and-test": "^2.0.0",
"viem": "2.x",
"wagmi": "2.x"
},
"devDependencies": {
"@synthetixio/synpress": "^3.7.2-beta.10",
"@biomejs/biome": "^1.6.1",
"@synthetixio/synpress": "^3.7.2-beta.10",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"buffer": "^6.0.3",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.2",
"vite": "^4.5.2"
}
Expand Down
23 changes: 22 additions & 1 deletion examples/wagmi/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import { defineConfig } from 'vite'
import { visualizer } from 'rollup-plugin-visualizer';
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
sourcemap: true,
cssCodeSplit: false,
chunkSizeWarningLimit: 2**20,
rollupOptions: {
output: {
inlineDynamicImports: true,
// Watch the output of `pnpm build`, make it fit in single 1mb chunk
//manualChunks: () => 'app'
},
},
},
plugins: [
react(),
visualizer({
template: 'treemap',
filename: 'stats.html',
sourcemap: true,
gzipSize: true
})
],
})
83 changes: 18 additions & 65 deletions pnpm-lock.yaml

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

0 comments on commit 195e537

Please sign in to comment.