-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
33 lines (31 loc) · 948 Bytes
/
vite.config.ts
File metadata and controls
33 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// vite.config.js
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill';
import react from '@vitejs/plugin-react';
import rollupNodePolyFill from 'rollup-plugin-polyfill-node'; // ✅ ADD THIS
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
import { pwaConfig } from './vite.pwa.config';
export default defineConfig({
server: {
port: 3000,
},
plugins: [react(), VitePWA(pwaConfig)],
build: {
rollupOptions: {
plugins: [rollupNodePolyFill()], // ✅ Add this to support Buffer in production
},
outDir: 'dist',
},
// Add any extra config if needed (aliases, environment vars, etc.)
optimizeDeps: {
exclude: ['bootstrap'],
include: ['buffer', 'process'],
},
resolve: {
alias: {
buffer: 'buffer',
process: 'process/browser',
},
},
});