-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
33 lines (32 loc) · 1.18 KB
/
vite.config.js
File metadata and controls
33 lines (32 loc) · 1.18 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import obfuscator from 'vite-plugin-javascript-obfuscator';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// 🛡️ SECURITY LAYER: Scrambles code during production build
obfuscator({
compact: true,
controlFlowFlattening: true, // Rewrites code flow to be confusing
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true, // Injects fake code to distract inspectors
deadCodeInjectionThreshold: 0.4,
debugProtection: true, // Disables console and debugger tools
debugProtectionInterval: 2000,
disableConsoleOutput: true, // Prevents others from seeing your logs
identifierNamesGenerator: 'hexadecimal', // Renames variables to hex strings like _0x1a2b
log: false,
renameGlobals: false,
rotateStringArray: true,
selfDefending: true, // Makes the code crash if someone tries to "beautify" it
stringArray: true,
stringArrayThreshold: 0.75,
}),
],
// OPTIONAL: Port configuration to keep your dev environment consistent
server: {
port: 5173,
strictPort: true,
},
});