diff --git a/packages/esbuild/index.js b/packages/esbuild/index.js index f9094e50..5450c111 100644 --- a/packages/esbuild/index.js +++ b/packages/esbuild/index.js @@ -63,7 +63,11 @@ export default [ async before(config) { if (config.saveBundle) { if (config.cleanDir) { - await rm(config.saveBundle, { force: true, recursive: true }) + await rm(config.saveBundle, { + force: true, + maxRetries: 3, + recursive: true + }) } else { let notEmpty = await isDirNotEmpty(config.saveBundle) if (notEmpty) { @@ -75,7 +79,11 @@ export default [ async finally(config, check) { if (check.esbuildOutfile && !config.saveBundle) { - await rm(check.esbuildOutfile, { force: true, recursive: true }) + await rm(check.esbuildOutfile, { + force: true, + maxRetries: 3, + recursive: true + }) } }, diff --git a/packages/webpack/index.js b/packages/webpack/index.js index ce19ab30..02ced120 100644 --- a/packages/webpack/index.js +++ b/packages/webpack/index.js @@ -59,7 +59,11 @@ export default [ async before(config) { if (config.saveBundle) { if (config.cleanDir) { - await rm(config.saveBundle, { force: true, recursive: true }) + await rm(config.saveBundle, { + force: true, + maxRetries: 3, + recursive: true + }) } else { let notEmpty = await isDirNotEmpty(config.saveBundle) if (notEmpty) { @@ -71,7 +75,11 @@ export default [ async finally(config, check) { if (check.webpackOutput && !config.saveBundle) { - await rm(check.webpackOutput, { force: true, recursive: true }) + await rm(check.webpackOutput, { + force: true, + maxRetries: 3, + recursive: true + }) } },