@taole/deploy-helper 1.1.0 → 1.1.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/lib/lightDeploy.mjs +9 -1
- package/package.json +1 -1
package/lib/lightDeploy.mjs
CHANGED
|
@@ -48,8 +48,15 @@ async function apiCdnUpload({ distZipPath, prefix, mode, includeHtml, entryHtmlM
|
|
|
48
48
|
return resJson;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* light模式部署
|
|
53
|
+
* @param {*} config 配置
|
|
54
|
+
* @param {*} mode 部署环境
|
|
55
|
+
*/
|
|
51
56
|
export async function lightDeploy(config, mode) {
|
|
52
|
-
|
|
57
|
+
const projectJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), "package.json"), "utf-8"));
|
|
58
|
+
const version = projectJson.version;
|
|
59
|
+
log(`light模式, 开始部署`, { mode, prefix: config.prefix, includeHtml: config.includeHtml, version });
|
|
53
60
|
|
|
54
61
|
if (!mode || (mode !== "test" && mode !== "prod")) {
|
|
55
62
|
throw new Error("部署环境无效,仅支持 test 或 prod");
|
|
@@ -91,6 +98,7 @@ export async function lightDeploy(config, mode) {
|
|
|
91
98
|
includeHtml,
|
|
92
99
|
entryHtmlMap: config.entryHtmlMap,
|
|
93
100
|
type: config.cdnType,
|
|
101
|
+
version,
|
|
94
102
|
},
|
|
95
103
|
userCache
|
|
96
104
|
);
|