import {defineConfig} from 'vite'; import obfuscatorPlugin from 'rollup-plugin-obfuscator'; export default defineConfig({ root: './src', // Set the root to the src directory build: { rollupOptions: { plugins: [ // Obfuscate code (applied after minification) obfuscatorPlugin({ options: { compact: true, controlFlowFlattening: true, stringArray: true, stringArrayThreshold: 0.75, }, }), ], input: './src/Imports/exploRUG.ts', output: { entryFileNames: '[name].js', // Removes hash from entry files chunkFileNames: '[name].js', // Removes hash from chunk files assetFileNames: 'assets/[name][extname]', // Removes hash from assets manualChunks(id) { if (id.includes('/Components/RoomView')) { return 'RoomView'; } return undefined; }, }, }, minify: 'terser', terserOptions: { format: { comments: false, }, }, outDir: '../dist', // Specify the output directory emptyOutDir: true, // Ensure the output directory is cleared on each build sourcemap: false, // <-- Add this line }, server: { host: true, port: 5173, }, });