Advertisement
FlyFar

vite.config.ts

Mar 29th, 2023
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.05 KB | Cryptocurrency | 0 0
  1. import { resolve } from "path";
  2. import obfuscator from "rollup-plugin-obfuscator";
  3. import { defineConfig } from "vite";
  4.  
  5. const root = resolve(__dirname, "src");
  6. const outDir = resolve(__dirname, "dist");
  7.  
  8. export default defineConfig({
  9.   root,
  10.   publicDir: resolve(__dirname, "public"),
  11.   build: {
  12.     outDir,
  13.     emptyOutDir: true,
  14.     rollupOptions: {
  15.       plugins: [
  16.         obfuscator({
  17.           fileOptions: {
  18.             compact: true,
  19.             controlFlowFlattening: true,
  20.             deadCodeInjection: true,
  21.             disableConsoleOutput: true,
  22.             renameGlobals: true,
  23.             rotateStringArray: true,
  24.             shuffleStringArray: true,
  25.             splitStrings: true,
  26.             splitStringsChunkLength: 5,
  27.             stringArray: true,
  28.             transformObjectKeys: true,
  29.           },
  30.         }),
  31.       ],
  32.       input: {
  33.         main: resolve(root, "index.html"),
  34.         about: resolve(root, "about", "index.html"),
  35.         iframe: resolve(root, "iframe", "index.html"),
  36.       },
  37.     },
  38.   },
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement