Skip to content

Commit

Permalink
Fix build mode node deps
Browse files Browse the repository at this point in the history
Use vite-plugin-node-polyfills even though its peer deps says it doesn't support vite 6...
  • Loading branch information
perliedman committed Dec 26, 2024
1 parent 6e3325a commit 9d4d40f
Show file tree
Hide file tree
Showing 3 changed files with 332 additions and 1 deletion.
329 changes: 329 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"postcss": "^8.4.49",
"tailwindcss": "^3.4.17",
"vite": "^6.0.5",
"vite-plugin-node-polyfills": "^0.22.0",
"worker-loader": "^3.0.8",
"xmldom": "^0.6.0"
}
Expand Down
3 changes: 2 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
import { nodePolyfills } from "vite-plugin-node-polyfills";

// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react(), nodePolyfills()],
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
Expand Down

0 comments on commit 9d4d40f

Please sign in to comment.