ms-vite-plugin 0.0.20 → 0.1.1
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 +5 -2
- package/package.json +4 -4
package/dist/build.js
CHANGED
|
@@ -71,7 +71,7 @@ async function findEntryFiles(src, baseDir) {
|
|
|
71
71
|
}
|
|
72
72
|
const buildAll = async (isDev = true, workspacePath) => {
|
|
73
73
|
const obfuscatorConfig = await fsExtra.readJSON(path.join(workspacePath, "obfuscator.json"));
|
|
74
|
-
const outputDir = path.join(workspacePath, "msbundle");
|
|
74
|
+
const outputDir = path.join(workspacePath, isDev ? "dist" : "msbundle");
|
|
75
75
|
const baseDir = path.join(workspacePath, "scripts");
|
|
76
76
|
const entryFiles = await findEntryFiles(baseDir, baseDir);
|
|
77
77
|
await fsExtra.remove(outputDir);
|
|
@@ -87,7 +87,7 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
87
87
|
formats: ["iife"],
|
|
88
88
|
name: "KuaiJS", // IIFE 格式必需的全局变量名
|
|
89
89
|
},
|
|
90
|
-
outDir: "msbundle/scripts",
|
|
90
|
+
outDir: isDev ? "dist/scripts" : "msbundle/scripts",
|
|
91
91
|
emptyOutDir: false, // 不要每次清空输出目录
|
|
92
92
|
sourcemap: isDev,
|
|
93
93
|
minify: !isDev, // 开发环境不压缩变量名
|
|
@@ -103,6 +103,9 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
103
103
|
],
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
+
if (isDev) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
106
109
|
// 打包完成后执行
|
|
107
110
|
await fsExtra.copy(path.join(workspacePath, "res"), path.join(workspacePath, "msbundle", "res"));
|
|
108
111
|
await fsExtra.copy(path.join(workspacePath, "ui"), path.join(workspacePath, "msbundle", "ui"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"prepublishOnly": "npm run build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"commander": "^14.0.
|
|
22
|
+
"commander": "^14.0.2",
|
|
23
23
|
"fs-extra": "^11.3.2",
|
|
24
|
-
"vite": "^7.1.
|
|
24
|
+
"vite": "^7.1.12",
|
|
25
25
|
"vite-plugin-bundle-obfuscator": "^1.8.0",
|
|
26
26
|
"zip-a-folder": "^3.1.9"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/fs-extra": "^11.0.4",
|
|
30
|
-
"@types/node": "^24.
|
|
30
|
+
"@types/node": "^24.9.1",
|
|
31
31
|
"typescript": "~5.9.3"
|
|
32
32
|
}
|
|
33
33
|
}
|