diff --git a/demos/vercel-deploy-tool/package.json b/demos/vercel-deploy-tool/package.json index d421528..8c6ce24 100644 --- a/demos/vercel-deploy-tool/package.json +++ b/demos/vercel-deploy-tool/package.json @@ -63,6 +63,7 @@ "vercel": "^34.2.7" }, "devDependencies": { + "@types/cpx": "^1.5.5", "@types/gulp": "^4.0.17", "@types/lodash-es": "^4.17.12", "@types/node": "^22.5.1", diff --git a/demos/vercel-deploy-tool/src/index.ts b/demos/vercel-deploy-tool/src/index.ts index 634ea3c..486ba0b 100644 --- a/demos/vercel-deploy-tool/src/index.ts +++ b/demos/vercel-deploy-tool/src/index.ts @@ -1,6 +1,7 @@ // 学习一下如何使用 https://github.com/sindresorhus/execa/blob/main/readme.md import fs from "node:fs"; import { dirname, resolve } from "node:path"; +import { cp } from "node:fs/promises"; import { execa } from "execa"; import { concat, isEmpty, isUndefined } from "lodash-es"; import { consola } from "consola"; @@ -9,6 +10,7 @@ import gulp from "gulp"; import { deleteAsync } from "del"; import { mkdirpSync } from "mkdirp"; import cpy from "cpy"; +import cpx from "cpx"; import { initVercelConfig, @@ -308,7 +310,9 @@ function generateCopyDistTasks(deployTarget: WithUserCommands) { consola.start(` 开始文件复制任务 `); consola.info(` 从 ${pathOutputDirectory} 开始 `); consola.info(` 复制到 ${pathVercelOutputStatic} 内`); - await cpy(pathOutputDirectory, pathVercelOutputStatic); + // await cp(pathOutputDirectory, pathVercelOutputStatic, { recursive: true }); + // await cpy(pathOutputDirectory, pathVercelOutputStatic); + await cpx.copy(pathOutputDirectory, pathVercelOutputStatic); consola.success(` 完成文件复制任务 `); }