pujiaming 2 jaren geleden
bovenliggende
commit
f58d588a23
3 gewijzigde bestanden met toevoegingen van 1328 en 11 verwijderingen
  1. 1271 11
      package-lock.json
  2. 1 0
      package.json
  3. 56 0
      vite.config.ts

File diff suppressed because it is too large
+ 1271 - 11
package-lock.json


+ 1 - 0
package.json

@@ -36,6 +36,7 @@
     "typescript": "^5.0.2",
     "unplugin-vue-components": "^0.25.1",
     "vite": "^4.4.5",
+    "vite-plugin-obfuscator": "^1.0.5",
     "vue-eslint-parser": "^9.3.1",
     "vue-tsc": "^1.8.5"
   }

+ 56 - 0
vite.config.ts

@@ -6,6 +6,7 @@ import postcsspxtoviewport from 'postcss-px-to-viewport-8-plugin'
 import autoprefixer from 'autoprefixer'
 import Components from 'unplugin-vue-components/vite'
 import { VantResolver } from 'unplugin-vue-components/resolvers'
+import { viteObfuscateFile } from 'vite-plugin-obfuscator'
 
 function pathResolve(dir) {
   // eslint-disable-next-line no-undef
@@ -40,6 +41,61 @@ export default defineConfig({
         'esnext.global-this',
         'esnext.string.match-all'
       ]
+    }),
+    viteObfuscateFile({
+      compact: true,
+      controlFlowFlattening: false,
+      controlFlowFlatteningThreshold: 0.75,
+      deadCodeInjection: false,
+      deadCodeInjectionThreshold: 0.4,
+      debugProtection: false,
+      debugProtectionInterval: 0,
+      disableConsoleOutput: false,
+      domainLock: [],
+      domainLockRedirectUrl: 'about:blank',
+      forceTransformStrings: [],
+      identifierNamesCache: null,
+      identifierNamesGenerator: 'hexadecimal',
+      identifiersDictionary: [],
+      identifiersPrefix: '',
+      ignoreImports: false,
+      inputFileName: '',
+      log: false,
+      numbersToExpressions: false,
+      optionsPreset: 'default',
+      renameGlobals: false,
+      renameProperties: false,
+      renamePropertiesMode: 'safe',
+      reservedNames: [],
+      reservedStrings: [],
+      seed: 0,
+      selfDefending: false,
+      simplify: true,
+      sourceMap: false,
+      sourceMapBaseUrl: '',
+      sourceMapFileName: '',
+      sourceMapMode: 'separate',
+      sourceMapSourcesMode: 'sources-content',
+      splitStrings: false,
+      splitStringsChunkLength: 10,
+      stringArray: true,
+      stringArrayCallsTransform: true,
+      stringArrayCallsTransformThreshold: 0.5,
+      stringArrayEncoding: [],
+      stringArrayIndexesType: [
+        'hexadecimal-number'
+      ],
+      stringArrayIndexShift: true,
+      stringArrayRotate: true,
+      stringArrayShuffle: true,
+      stringArrayWrappersCount: 1,
+      stringArrayWrappersChainedCalls: true,
+      stringArrayWrappersParametersMaxCount: 2,
+      stringArrayWrappersType: 'variable',
+      stringArrayThreshold: 0.75,
+      target: 'browser',
+      transformObjectKeys: false,
+      unicodeEscapeSequence: false
     })
 
   ],