@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.
@@ -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
- log(`light模式, 开始部署`, { mode, prefix: config.prefix, includeHtml: config.includeHtml });
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
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",