Skip to content

Commit d5f0f95

Browse files
committed
feat: add node polyfills plugin to Vite configuration
1 parent 340ddb4 commit d5f0f95

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/react-app/vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import react from '@vitejs/plugin-react';
22
import tailwindcss from 'tailwindcss';
33
import { defineConfig } from 'vite';
4+
import { nodePolyfills } from 'vite-plugin-node-polyfills';
45

56
// https://vitejs.dev/config/
67
export default defineConfig({
7-
plugins: [react()],
8+
plugins: [
9+
react(),
10+
nodePolyfills({
11+
include: ['buffer', 'crypto', 'stream', 'util'],
12+
}),
13+
],
814
css: {
915
postcss: {
1016
plugins: [tailwindcss()],

0 commit comments

Comments
 (0)