ms-vite-plugin 0.3.4 → 0.3.5
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/dist/build.js +8 -1
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -282,12 +282,19 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
282
282
|
for (const file of luaFiles) {
|
|
283
283
|
const rel = path.relative(scriptsDir, file);
|
|
284
284
|
console.log(`🛠️ 混淆 Lua: ${rel}`);
|
|
285
|
-
const r = (0, child_process_1.spawnSync)(process.execPath, [cliPath, rel, "--preset", "
|
|
285
|
+
const r = (0, child_process_1.spawnSync)(process.execPath, [cliPath, rel, "--preset", "Medium"], { cwd: scriptsDir, encoding: "utf8" });
|
|
286
286
|
if (r.status !== 0) {
|
|
287
287
|
console.error("❌ 混淆 Lua 失败:", rel);
|
|
288
288
|
console.error(r.stderr || r.stdout || "");
|
|
289
289
|
process.exit(1);
|
|
290
290
|
}
|
|
291
|
+
const obfRel = rel.replace(/\.lua$/, ".obfuscated.lua");
|
|
292
|
+
const obfPath = path.join(scriptsDir, obfRel);
|
|
293
|
+
if (await fsExtra.pathExists(obfPath)) {
|
|
294
|
+
// 删除原文件并将混淆文件改回原文件名
|
|
295
|
+
await fsExtra.remove(file);
|
|
296
|
+
await fsExtra.move(obfPath, file, { overwrite: true });
|
|
297
|
+
}
|
|
291
298
|
}
|
|
292
299
|
console.log("✅ Lua 混淆完成");
|
|
293
300
|
}
|