-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
24 lines (23 loc) · 755 Bytes
/
Copy pathvite.config.ts
File metadata and controls
24 lines (23 loc) · 755 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
import path from 'node:path';
import { cloudflare } from '@cloudflare/vite-plugin';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
react(),
cloudflare({
config:
process.env.CLOUDFLARE_REMOTE_BROWSER === 'true'
? { browser: { binding: 'BROWSER', remote: true } }
: undefined,
}),
],
resolve: {
alias: [{ find: '@', replacement: path.resolve(import.meta.dirname, 'src') }],
},
server: {
// Vite ignores PORT by default. Honoring it lets a second dev server pick a
// free port instead of colliding with one already running on the default.
port: process.env.PORT ? Number(process.env.PORT) : undefined,
},
});