ms-vite-plugin 0.2.6 → 0.2.7
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/dist/cli.js +2 -5
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -111,7 +111,14 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
111
111
|
const isJs = await fsExtra.pathExists(path.join(workspacePath, "scripts", "main.js"));
|
|
112
112
|
if (isJs) {
|
|
113
113
|
console.log("🚀 开始构建JavaScript项目...");
|
|
114
|
-
const
|
|
114
|
+
const obfuscatorConfigPath = path.join(workspacePath, "obfuscator.json");
|
|
115
|
+
if (!(await fsExtra.pathExists(obfuscatorConfigPath))) {
|
|
116
|
+
console.error("❌ 错误: 当前目录不是有效的 快点JS 项目");
|
|
117
|
+
console.error("请确保目录包含以下文件:");
|
|
118
|
+
console.error(" - obfuscator.json");
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
const obfuscatorConfig = await fsExtra.readJSON(obfuscatorConfigPath);
|
|
115
122
|
const outputDir = path.join(workspacePath, isDev ? "dist" : "msbundle");
|
|
116
123
|
const baseDir = path.join(workspacePath, "scripts");
|
|
117
124
|
const entryFiles = await findEntryFiles(baseDir, baseDir);
|
package/dist/cli.js
CHANGED
|
@@ -47,13 +47,11 @@ async function isValidKuaiJSProject(workspacePath) {
|
|
|
47
47
|
try {
|
|
48
48
|
const packageJsonPath = path.join(workspacePath, "package.json");
|
|
49
49
|
const scriptsPath = path.join(workspacePath, "scripts");
|
|
50
|
-
const
|
|
51
|
-
const [packageExists, scriptsExists, obfuscatorExists] = await Promise.all([
|
|
50
|
+
const [packageExists, scriptsExists] = await Promise.all([
|
|
52
51
|
fsExtra.pathExists(packageJsonPath),
|
|
53
52
|
fsExtra.pathExists(scriptsPath),
|
|
54
|
-
fsExtra.pathExists(obfuscatorPath),
|
|
55
53
|
]);
|
|
56
|
-
return packageExists && scriptsExists
|
|
54
|
+
return packageExists && scriptsExists;
|
|
57
55
|
}
|
|
58
56
|
catch {
|
|
59
57
|
return false;
|
|
@@ -75,7 +73,6 @@ async function buildCommand(options) {
|
|
|
75
73
|
console.error("请确保目录包含以下文件:");
|
|
76
74
|
console.error(" - package.json");
|
|
77
75
|
console.error(" - scripts/ 目录");
|
|
78
|
-
console.error(" - obfuscator.json");
|
|
79
76
|
process.exit(1);
|
|
80
77
|
}
|
|
81
78
|
console.log(`🚀 开始构建项目 (${isDev ? "开发模式" : "生产模式"})...`);
|