Skip to content

Commit

Permalink
deps(SPV-1286): add pollyfil for Buffer; update vite and logging tool…
Browse files Browse the repository at this point in the history
…s; remove pino-pretty - unused dep
  • Loading branch information
dzolt-4chain committed Dec 12, 2024
1 parent 0b79b3c commit d45ea95
Show file tree
Hide file tree
Showing 4 changed files with 1,042 additions and 355 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"date-fns": "^3.6.0",
"lucide-react": "^0.436.0",
"next-themes": "^0.3.0",
"pino": "^9.1.0",
"pino-pretty": "^11.0.0",
"pino": "^9.5.0",
"react": "^18.2.0",
"react-day-picker": "^8.10.1",
"react-dom": "^18.2.0",
Expand All @@ -59,6 +58,7 @@
"tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss-animate": "^1.0.7",
"use-debounce": "^10.0.3",
"vite-plugin-node-polyfills": "^0.22.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand All @@ -72,7 +72,7 @@
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"@vitejs/plugin-react-swc": "^3.7.2",
"@vitest/coverage-v8": "^2.0.5",
"autoprefixer": "^10.4.19",
"eslint": "^9.8.0",
Expand All @@ -86,7 +86,7 @@
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2",
"typescript-eslint": "^7.9.0",
"vite": "^5.2.0",
"vite": "^6.0.3",
"vite-plugin-eslint": "^1.8.1",
"vitest": "^2.0.5"
},
Expand Down
6 changes: 0 additions & 6 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import { StrictMode } from 'react';
import ReactDOM from 'react-dom/client';
import App from '@/App.tsx';
import './index.css';
import { Buffer } from 'buffer';

// We need this global assignment to be able to use Buffer from different libraries.
// If no other plugin sets the buffer it will be seen as undefined by the browser.
// i.e HD.fromString() uses Buffer underneath and causes app to throw errors
globalThis.Buffer = Buffer;

// Render the app
const rootElement = document.getElementById('app')!;
Expand Down
12 changes: 11 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import { TanStackRouterVite } from '@tanstack/router-vite-plugin';
import path from 'path';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export const srcAlias = {
'@': path.resolve(__dirname, './src'),
};

// https://vitejs.dev/config/
export default defineConfig({
plugins: [TanStackRouterVite(), react()],
plugins: [
TanStackRouterVite(),
react(),
nodePolyfills({
include: ['buffer'],
globals: {
Buffer: true,
},
}),
],
resolve: {
alias: srcAlias,
},
Expand Down
Loading

0 comments on commit d45ea95

Please sign in to comment.