|
@@ -5,7 +5,7 @@ import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
-import obfuscator from "rollup-plugin-obfuscator";
|
|
|
|
|
|
+// import obfuscator from "rollup-plugin-obfuscator";
|
|
|
|
|
|
const SERVER_URL = "https://192.168.10.39";
|
|
const SERVER_URL = "https://192.168.10.39";
|
|
const path = require("path");
|
|
const path = require("path");
|
|
@@ -47,70 +47,93 @@ export default defineConfig({
|
|
targets: ["chrome >= 58"],
|
|
targets: ["chrome >= 58"],
|
|
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
|
|
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
|
|
}),
|
|
}),
|
|
- process.env.NODE_ENV === "development"
|
|
|
|
- ? {}
|
|
|
|
- : obfuscator({
|
|
|
|
- // 不同的构建可能成功运行也可能不成功?
|
|
|
|
- // 看看是不是单个文件做transform,然后对最终文件做renderChunk导致的构建结果不一致
|
|
|
|
- fileOptions: false,
|
|
|
|
- // fileOptions: {
|
|
|
|
- // optionsPreset: "low-obfuscation",
|
|
|
|
- // debugProtection: false,
|
|
|
|
- // transformObjectKeys: false,
|
|
|
|
- // disableConsoleOutput: false,
|
|
|
|
- // // controlFlowFlattening: true,
|
|
|
|
- // controlFlowFlatteningThreshold: 0.9,
|
|
|
|
- // // per-file:
|
|
|
|
- // deadCodeInjection: true,
|
|
|
|
- // deadCodeInjectionThreshold: 1,
|
|
|
|
- // // stringArrayThreshold: 1,
|
|
|
|
- // // numbersToExpressions: true,
|
|
|
|
- // // controlFlowFlatteningThreshold: 1,
|
|
|
|
- // // stringArrayCallsTransform: true,
|
|
|
|
- // // stringArrayCallsTransformThreshold: 1,
|
|
|
|
- // // stringArrayEncoding: ["rc4"],
|
|
|
|
- // },
|
|
|
|
- globalOptions: {
|
|
|
|
- optionsPreset: "low-obfuscation",
|
|
|
|
- // debugProtection: true,
|
|
|
|
- // debugProtectionInterval: 2000,
|
|
|
|
- // domainLock: [
|
|
|
|
- // ".exam-cloud.cn",
|
|
|
|
- // ".test41v3.qmth.com.cn",
|
|
|
|
- // ".ea100.com.cn",
|
|
|
|
- // ".ecs.qmth.com.cn",
|
|
|
|
- // ".qmth.com.cn",
|
|
|
|
- // ".dev39.qmth.com.cn",
|
|
|
|
- // ".test41.qmth.com.cn",
|
|
|
|
- // ],
|
|
|
|
- domainLock: [],
|
|
|
|
- // selfDefending: true,
|
|
|
|
- // sourceMap: false,
|
|
|
|
- // splitStrings: true,
|
|
|
|
- disableConsoleOutput: false,
|
|
|
|
- // // stringArrayCallsTransform: true,
|
|
|
|
- // deadCodeInjection: true,
|
|
|
|
- // numbersToExpressions: true,
|
|
|
|
- controlFlowFlattening: true,
|
|
|
|
- // stringArrayEncoding: ["none", "base64", "rc4"],
|
|
|
|
- // stringArrayRotate: true,
|
|
|
|
- // transformObjectKeys: true,
|
|
|
|
- },
|
|
|
|
- include: [
|
|
|
|
- // "src/**/**.ts",
|
|
|
|
- // "src/**/**.js",
|
|
|
|
- "src/utils/**.ts",
|
|
|
|
- // "**/UserLogin/**.ts",
|
|
|
|
- // "**/Examing/**/**.ts",
|
|
|
|
- ],
|
|
|
|
- exclude: ["node_modules/**"],
|
|
|
|
- ...(disableObfuse
|
|
|
|
- ? {
|
|
|
|
- fileOptions: false,
|
|
|
|
- globalOptions: false,
|
|
|
|
- }
|
|
|
|
- : {}),
|
|
|
|
- }),
|
|
|
|
|
|
+ // process.env.NODE_ENV === "development"
|
|
|
|
+ // ? {}
|
|
|
|
+ // : // : obfuscator({
|
|
|
|
+ // // 不同的构建可能成功运行也可能不成功?
|
|
|
|
+ // // 看看是不是单个文件做transform,然后对最终文件做renderChunk导致的构建结果不一致
|
|
|
|
+ // fileOptions: false,
|
|
|
|
+ // // fileOptions: {
|
|
|
|
+ // // optionsPreset: "low-obfuscation",
|
|
|
|
+ // // debugProtection: false,
|
|
|
|
+ // // transformObjectKeys: false,
|
|
|
|
+ // // disableConsoleOutput: false,
|
|
|
|
+ // // // controlFlowFlattening: true,
|
|
|
|
+ // // controlFlowFlatteningThreshold: 0.9,
|
|
|
|
+ // // // per-file:
|
|
|
|
+ // // deadCodeInjection: true,
|
|
|
|
+ // // deadCodeInjectionThreshold: 1,
|
|
|
|
+ // // // stringArrayThreshold: 1,
|
|
|
|
+ // // // numbersToExpressions: true,
|
|
|
|
+ // // // controlFlowFlatteningThreshold: 1,
|
|
|
|
+ // // // stringArrayCallsTransform: true,
|
|
|
|
+ // // // stringArrayCallsTransformThreshold: 1,
|
|
|
|
+ // // // stringArrayEncoding: ["rc4"],
|
|
|
|
+ // // },
|
|
|
|
+ // globalOptions: {
|
|
|
|
+ // optionsPreset: "low-obfuscation",
|
|
|
|
+ // // debugProtection: true,
|
|
|
|
+ // // debugProtectionInterval: 2000,
|
|
|
|
+ // // domainLock: [
|
|
|
|
+ // // ".exam-cloud.cn",
|
|
|
|
+ // // ".test41v3.qmth.com.cn",
|
|
|
|
+ // // ".ea100.com.cn",
|
|
|
|
+ // // ".ecs.qmth.com.cn",
|
|
|
|
+ // // ".qmth.com.cn",
|
|
|
|
+ // // ".dev39.qmth.com.cn",
|
|
|
|
+ // // ".test41.qmth.com.cn",
|
|
|
|
+ // // ],
|
|
|
|
+ // domainLock: [],
|
|
|
|
+ // // selfDefending: true,
|
|
|
|
+ // // sourceMap: false,
|
|
|
|
+ // // splitStrings: true,
|
|
|
|
+ // disableConsoleOutput: false,
|
|
|
|
+ // // // stringArrayCallsTransform: true,
|
|
|
|
+ // // deadCodeInjection: true,
|
|
|
|
+ // // numbersToExpressions: true,
|
|
|
|
+ // controlFlowFlattening: true,
|
|
|
|
+ // // stringArrayEncoding: ["none", "base64", "rc4"],
|
|
|
|
+ // // stringArrayRotate: true,
|
|
|
|
+ // // transformObjectKeys: true,
|
|
|
|
+ // },
|
|
|
|
+ // include: [
|
|
|
|
+ // // "src/**/**.ts",
|
|
|
|
+ // // "src/**/**.js",
|
|
|
|
+ // "src/utils/**.ts",
|
|
|
|
+ // // "**/UserLogin/**.ts",
|
|
|
|
+ // // "**/Examing/**/**.ts",
|
|
|
|
+ // ],
|
|
|
|
+ // exclude: ["node_modules/**"],
|
|
|
|
+ // ...(disableObfuse
|
|
|
|
+ // ? {
|
|
|
|
+ // fileOptions: false,
|
|
|
|
+ // globalOptions: false,
|
|
|
|
+ // }
|
|
|
|
+ // : {}),
|
|
|
|
+ // }),
|
|
|
|
+ // javascriptObfuscator({
|
|
|
|
+ // compact: true,
|
|
|
|
+ // controlFlowFlattening: true,
|
|
|
|
+ // controlFlowFlatteningThreshold: 1,
|
|
|
|
+ // deadCodeInjection: true,
|
|
|
|
+ // deadCodeInjectionThreshold: 1,
|
|
|
|
+ // debugProtection: true,
|
|
|
|
+ // debugProtectionInterval: 0,
|
|
|
|
+ // disableConsoleOutput: true,
|
|
|
|
+ // identifierNamesGenerator: "hexadecimal",
|
|
|
|
+ // log: false,
|
|
|
|
+ // renameGlobals: false,
|
|
|
|
+ // rotateStringArray: true,
|
|
|
|
+ // selfDefending: true,
|
|
|
|
+ // shuffleStringArray: true,
|
|
|
|
+ // splitStrings: true,
|
|
|
|
+ // splitStringsChunkLength: 10,
|
|
|
|
+ // stringArray: true,
|
|
|
|
+ // stringArrayEncoding: ["rc4"],
|
|
|
|
+ // stringArrayThreshold: 1,
|
|
|
|
+ // transformObjectKeys: true,
|
|
|
|
+ // unicodeEscapeSequence: false,
|
|
|
|
+ // }),
|
|
],
|
|
],
|
|
server: {
|
|
server: {
|
|
port: 3000,
|
|
port: 3000,
|