@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.
- package/lib/offlinePkg.mjs +9 -9
- package/package.json +1 -1
package/lib/offlinePkg.mjs
CHANGED
|
@@ -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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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 {
|