Skip to content

Commit 8aaa9df

Browse files
committedJan 22, 2025
fix: swc compiler does not watch files
1 parent 2fa2079 commit 8aaa9df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎lib/compiler/swc/swc-compiler.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ export class SwcCompiler extends BaseCompiler {
252252
const dir = isAbsolute(options.cliOptions.outDir!)
253253
? options.cliOptions.outDir!
254254
: join(process.cwd(), options.cliOptions.outDir!);
255-
const paths = join(dir, '**/*.js');
256-
const watcher = chokidar.watch(paths, {
255+
const watcher = chokidar.watch(dir, {
256+
ignored: (file, stats) =>
257+
(stats?.isFile() && !file.endsWith('.js')) as boolean,
257258
ignoreInitial: true,
258259
awaitWriteFinish: {
259260
stabilityThreshold: 50,

0 commit comments

Comments
 (0)