* 验证路径是否存在 * @param {string} resPath 资源路径 * @param {string} settingsPath 设置文件路径 * @param {string} projectPath 项目文件路径
(resPath, settingsPath, projectPath)
| 342 | |
| 343 | // Version hint: 3.x → bundle pipeline |
| 344 | if (versionHint === '3.x') { |
| 345 | for (const root of uniqueCandidateRoots) { |
| 346 | if (isBundleRoot(root)) { |
| 347 | logger.info('使用用户指定的Cocos Creator 3.x项目结构'); |
| 348 | return { version: '3.x', sourcePath: root }; |
| 349 | } |
| 350 | } |
| 351 | logger.warn('用户指定3.x版本,但未找到对应文件结构,尝试自动检测...'); |
| 352 | } |
| 353 | |
| 354 | // Version hint: 2.4.x |
| 355 | // Prefer bundle layout when present (MD5 Cache / 2.4 bundle builds). Forcing |
| 356 | // the classic 2.x pipeline on those projects yields JSON "textures" and fails |
| 357 | // to parse config.<hash>.json — the root cause of issue #31. |
| 358 | if (versionHint === '2.4.x') { |
| 359 | for (const root of uniqueCandidateRoots) { |