Files
Krunker-Civilian-Client-Test/vite.preload.config.ts
T
bigjakk 467ac95b4e v0.5.3 — Fix resource swapper, add Husky, remove uuid
Fix three Electron 12→42 protocol migration bugs in the resource swapper:
register protocol on the app session instead of default, generate valid
URLs from Windows paths, and prevent non-swapped krunker.io requests from
being cancelled. Swapper now rescans on page refresh to pick up file changes.

Add Husky pre-commit hook to run ESLint. Remove unused uuid dependency.
Update README with lint script, husky, and swapper improvements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:19:10 -08:00

23 lines
522 B
TypeScript

import { defineConfig } from 'vite';
import { resolve } from 'path';
const isProd = process.env.NODE_ENV === 'production' || !process.argv.includes('--mode');
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/preload/index.ts'),
formats: ['cjs'],
fileName: () => 'index.js',
},
outDir: 'dist/preload',
emptyDirBefore: true,
rollupOptions: {
external: ['electron'],
},
target: 'node20',
minify: isProd,
sourcemap: !isProd,
},
});