467ac95b4e
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>
23 lines
522 B
TypeScript
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,
|
|
},
|
|
});
|