65 lines
1.7 KiB
TypeScript
65 lines
1.7 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
tailwindcss(),
|
|
vitePluginBundleObfuscator({
|
|
apply: 'build',
|
|
log: true,
|
|
autoExcludeNodeModules: true,
|
|
threadPool: true,
|
|
excludes: [
|
|
/assets\/rolldown-runtime-.*\.js$/,
|
|
],
|
|
options: {
|
|
compact: true,
|
|
controlFlowFlattening: false,
|
|
deadCodeInjection: false,
|
|
debugProtection: false,
|
|
debugProtectionInterval: 0,
|
|
disableConsoleOutput: true,
|
|
identifierNamesGenerator: 'hexadecimal',
|
|
ignoreImports: true,
|
|
numbersToExpressions: false,
|
|
renameGlobals: false,
|
|
selfDefending: false,
|
|
simplify: true,
|
|
splitStrings: false,
|
|
stringArray: true,
|
|
stringArrayCallsTransform: false,
|
|
stringArrayEncoding: [],
|
|
stringArrayIndexShift: true,
|
|
stringArrayRotate: true,
|
|
stringArrayShuffle: true,
|
|
stringArrayWrappersChainedCalls: true,
|
|
stringArrayWrappersCount: 1,
|
|
stringArrayWrappersParametersMaxCount: 2,
|
|
stringArrayWrappersType: 'variable',
|
|
stringArrayThreshold: 0.75,
|
|
transformObjectKeys: false,
|
|
unicodeEscapeSequence: false,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
port: 3200,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8091',
|
|
changeOrigin: true,
|
|
rewrite: (path: string) => path.replace(/^\/api/, ''),
|
|
}
|
|
}
|
|
}
|
|
})
|