feat: 初始化提交
This commit is contained in:
39
client/vite.config.ts
Normal file
39
client/vite.config.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import react from '@vitejs/plugin-react-swc'
|
||||
import {defineConfig, type UserConfig} from 'vite'
|
||||
import obfuscatorPlugin from 'vite-plugin-javascript-obfuscator'
|
||||
// @ts-ignore
|
||||
import packageJson from './package.json'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({mode}) => {
|
||||
let config: UserConfig = {
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(packageJson.version) ?? '0.0.0',
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
obfuscatorPlugin({
|
||||
apply: config => config['mode'] === 'production',
|
||||
options: {
|
||||
compact: true,
|
||||
controlFlowFlattening: true,
|
||||
controlFlowFlatteningThreshold: 0.75,
|
||||
deadCodeInjection: true,
|
||||
deadCodeInjectionThreshold: 0.4,
|
||||
debugProtection: false,
|
||||
disableConsoleOutput: true,
|
||||
identifierNamesGenerator: 'hexadecimal',
|
||||
renameGlobals: false,
|
||||
stringArrayRotate: true,
|
||||
selfDefending: true,
|
||||
stringArray: true,
|
||||
stringArrayEncoding: ['base64'],
|
||||
stringArrayThreshold: 0.75,
|
||||
transformObjectKeys: true,
|
||||
unicodeEscapeSequence: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
}
|
||||
return config
|
||||
})
|
||||
Reference in New Issue
Block a user