-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
36 lines (34 loc) · 1.2 KB
/
vite.config.ts
File metadata and controls
36 lines (34 loc) · 1.2 KB
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
34
35
36
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
import { readFileSync } from 'fs';
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, 'package.json'), 'utf-8'));
export default defineConfig({
plugins: [
react(),
tailwindcss(),
{
name: 'html-inject-version',
transformIndexHtml(html) {
return html.replace('<title>Fetch Boy</title>', `<title>Fetch Boy v${pkg.version}</title>`);
},
},
],
resolve: {
alias: { '@': path.resolve(__dirname, './src') },
},
// Tauri expects a fixed dev server port
server: {
port: 1420,
strictPort: true,
},
envPrefix: ['VITE_', 'TAURI_'],
// QuickJS WASM must not be bundled by esbuild — let the browser fetch .wasm natively
optimizeDeps: {
exclude: ['quickjs-emscripten', 'quickjs-emscripten-core',
'@jitl/quickjs-wasmfile-release-sync', '@jitl/quickjs-wasmfile-release-asyncify',
'@jitl/quickjs-wasmfile-debug-sync', '@jitl/quickjs-wasmfile-debug-asyncify'],
},
assetsInclude: ['**/*.wasm'],
});