ms-vite-plugin 0.3.0 → 0.3.2
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 +6 -2
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -115,8 +115,9 @@ function prodReturnMain() {
|
|
|
115
115
|
*/
|
|
116
116
|
function detectPython314() {
|
|
117
117
|
const candidates = [
|
|
118
|
-
{ cmd: "
|
|
118
|
+
{ cmd: "python", args: ["--version"] },
|
|
119
119
|
{ cmd: "python3", args: ["--version"] },
|
|
120
|
+
{ cmd: "python3.14", args: ["--version"] },
|
|
120
121
|
];
|
|
121
122
|
for (const c of candidates) {
|
|
122
123
|
try {
|
|
@@ -181,6 +182,7 @@ async function normalizePythonArtifacts(rootDir) {
|
|
|
181
182
|
const buildAll = async (isDev = true, workspacePath) => {
|
|
182
183
|
const isJs = await fsExtra.pathExists(path.join(workspacePath, "scripts", "main.js"));
|
|
183
184
|
const isPy = await fsExtra.pathExists(path.join(workspacePath, "scripts", "main.py"));
|
|
185
|
+
const isLua = await fsExtra.pathExists(path.join(workspacePath, "scripts", "main.lua"));
|
|
184
186
|
if (isJs) {
|
|
185
187
|
console.log("🚀 开始构建JavaScript项目...");
|
|
186
188
|
const obfuscatorConfigPath = path.join(workspacePath, "obfuscator.json");
|
|
@@ -230,8 +232,10 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
230
232
|
}
|
|
231
233
|
const outPath = path.join(workspacePath, "msbundle");
|
|
232
234
|
await fsExtra.ensureDir(outPath);
|
|
233
|
-
if (isPy) {
|
|
235
|
+
if (isPy || isLua) {
|
|
234
236
|
await fsExtra.copy(path.join(workspacePath, "scripts"), path.join(outPath, "scripts"));
|
|
237
|
+
}
|
|
238
|
+
if (isPy) {
|
|
235
239
|
// 获取系统有没有 3.14 版本的 python
|
|
236
240
|
const py = detectPython314();
|
|
237
241
|
if (py.ok) {
|