@taole/deploy-helper 0.6.0 → 0.6.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.
@@ -138,7 +138,7 @@ export function checkOfflinePkg(config) {
138
138
  if (!fs.existsSync(distPath)) {
139
139
  errorMsg = `构建产物${distPath}不存在, 请先构建项目`;
140
140
  canBuildOfflinePkg = false;
141
- } else if (!offlineConfig) {
141
+ } else if (!offlineConfig || !offlineConfig.name) {
142
142
  errorMsg = ""; // 没有离线包配置文件,跳过构建离线包
143
143
  canBuildOfflinePkg = false;
144
144
  } else if (!userDeployHelperConfig || !userDeployHelperConfig.offlineApi || !userDeployHelperConfig.offlineApi.get || !userDeployHelperConfig.offlineApi.set) {
@@ -149,14 +149,14 @@ export function checkOfflinePkg(config) {
149
149
  canBuildOfflinePkg = false;
150
150
  } else {
151
151
  // 暂时不检查这个
152
- // const allDeps = {
153
- // ...packageJson.devDependencies,
154
- // ...packageJson.dependencies,
155
- // };
156
- // if(!allDeps['@vitejs/plugin-legacy'] || !allDeps['vite-plugin-dynamic-base']){
157
- // errorMsg = "检查到项目中未安装依赖@vitejs/plugin-legacy和vite-plugin-dynamic-base, 请先安装依赖并调整构建代码以支持离线化";
158
- // canBuildOfflinePkg = false;
159
- // }
152
+ const allDeps = {
153
+ ...packageJson.devDependencies,
154
+ ...packageJson.dependencies,
155
+ };
156
+ if(!allDeps['@vitejs/plugin-legacy'] || !allDeps['vite-plugin-dynamic-base']){
157
+ errorMsg = "检查到项目中未安装依赖@vitejs/plugin-legacy和vite-plugin-dynamic-base, 请先安装依赖并调整构建代码以支持离线化";
158
+ canBuildOfflinePkg = false;
159
+ }
160
160
  }
161
161
  if (!canBuildOfflinePkg) {
162
162
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",