From dce4be946b29a2f10ba15064681ad222ab730e79 Mon Sep 17 00:00:00 2001 From: Peach Date: Tue, 7 Nov 2023 17:35:50 +0800 Subject: [PATCH] fix: ignore fs-specific tmp files in watch mode (#729) --- src/builder/bundless/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/builder/bundless/index.ts b/src/builder/bundless/index.ts index 4aaaa23b..9f781990 100644 --- a/src/builder/bundless/index.ts +++ b/src/builder/bundless/index.ts @@ -14,10 +14,10 @@ import { DEFAULT_BUNDLESS_IGNORES, WATCH_DEBOUNCE_STEP, } from '../../constants'; +import { logger } from '../../utils'; import type { BundlessConfigProvider } from '../config'; import getDeclarations from './dts'; import runLoaders from './loaders'; -import { logger } from '../../utils'; const debugLog = debug(DEBUG_BUNDLESS_NAME); @@ -203,6 +203,12 @@ async function bundless( cwd: opts.cwd, ignoreInitial: true, ignored: DEFAULT_BUNDLESS_IGNORES, + // to avoid catch temp file from some special file-system + // ex. a.txt => a.txt.12344345 in CloudIDE + awaitWriteFinish: { + stabilityThreshold: 20, + pollInterval: 10, + }, }) .on('add', handleTransform) .on('change', handleTransform)