cicy-desktop 2.1.248 → 2.1.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/linux-app-release.yml +1 -0
- package/.github/workflows/mac-app-release.yml +1 -0
- package/.github/workflows/windows-exe-release.yml +1 -0
- package/package.json +5 -4
- package/scripts/obfuscate.cjs +81 -0
- package/workers/render/package-lock.json +1495 -33
- package/workers/render/package.json +1 -0
- package/workers/render/vite.config.js +31 -1
|
@@ -3,11 +3,41 @@
|
|
|
3
3
|
|
|
4
4
|
import { defineConfig } from "vite";
|
|
5
5
|
import react from "@vitejs/plugin-react";
|
|
6
|
+
import obfuscator from "vite-plugin-javascript-obfuscator";
|
|
6
7
|
|
|
7
8
|
// base: "./" so the built bundle's relative asset URLs resolve under
|
|
8
9
|
// file:// when cicy-desktop loads src/backends/homepage-react/index.html.
|
|
10
|
+
//
|
|
11
|
+
// 发版时(CICY_OBFUSCATE=1,只在 release CI 设)对**构建产物**再做一层混淆 —— Vite 本身已经
|
|
12
|
+
// minify(变量已改名),这层进一步打乱字符串等。保守配置(不开 controlFlowFlattening /
|
|
13
|
+
// deadCodeInjection / selfDefending)以免搞坏 React 运行时。dev 与本地普通 build 不启用、零影响。
|
|
14
|
+
const OBFUSCATE = process.env.CICY_OBFUSCATE === "1";
|
|
15
|
+
|
|
9
16
|
export default defineConfig({
|
|
10
|
-
plugins: [
|
|
17
|
+
plugins: [
|
|
18
|
+
react(),
|
|
19
|
+
...(OBFUSCATE
|
|
20
|
+
? [obfuscator({
|
|
21
|
+
include: ["**/*.js"],
|
|
22
|
+
exclude: [/node_modules/],
|
|
23
|
+
apply: "build",
|
|
24
|
+
options: {
|
|
25
|
+
compact: true,
|
|
26
|
+
simplify: true,
|
|
27
|
+
identifierNamesGenerator: "hexadecimal",
|
|
28
|
+
renameGlobals: false,
|
|
29
|
+
stringArray: true,
|
|
30
|
+
stringArrayThreshold: 0.75,
|
|
31
|
+
stringArrayEncoding: ["base64"],
|
|
32
|
+
controlFlowFlattening: false,
|
|
33
|
+
deadCodeInjection: false,
|
|
34
|
+
selfDefending: false,
|
|
35
|
+
debugProtection: false,
|
|
36
|
+
disableConsoleOutput: false,
|
|
37
|
+
},
|
|
38
|
+
})]
|
|
39
|
+
: []),
|
|
40
|
+
],
|
|
11
41
|
base: "./",
|
|
12
42
|
server: { host: "0.0.0.0", port: 8173 },
|
|
13
43
|
});
|