@@ -30,18 +30,26 @@ export async function watchCompile(
30
30
watcher . on ( 'change' , async ( filepath ) => {
31
31
if ( esm ) {
32
32
const output = filepath . replace ( entryDir , esm ) ;
33
- if ( ! disableBabel && isMatch ( output , [ '**/*.[jt]s?(x)' ] ) && ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/?(*.)+d.ts' ] ) ) {
33
+ if (
34
+ ! disableBabel &&
35
+ isMatch ( output , [ '**/*.[jt]s?(x)' ] ) &&
36
+ ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' ] )
37
+ ) {
34
38
transform ( filepath , { entryDir, esm, ...other } ) ;
35
- } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , 'tsconfig.json' , '**/?(*.)+ d.ts' ] ) ) {
39
+ } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , 'tsconfig.json' , '**/*. d.ts' ] ) ) {
36
40
const result = ts . sys . readFile ( filepath ) ;
37
41
outputFiles ( output , result ) ;
38
42
}
39
43
}
40
44
if ( cjs ) {
41
45
const output = filepath . replace ( entryDir , cjs ) ;
42
- if ( ! disableBabel && isMatch ( output , [ '**/*.[jt]s?(x)' ] ) && ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/?(*.)+d.ts' ] ) ) {
46
+ if (
47
+ ! disableBabel &&
48
+ isMatch ( output , [ '**/*.[jt]s?(x)' ] ) &&
49
+ ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' ] )
50
+ ) {
43
51
transform ( filepath , { entryDir, cjs, ...other } ) ;
44
- } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , 'tsconfig.json' , '**/?(*.)+ d.ts' ] ) ) {
52
+ } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , 'tsconfig.json' , '**/*. d.ts' ] ) ) {
45
53
const result = ts . sys . readFile ( filepath ) ;
46
54
outputFiles ( output , result ) ;
47
55
}
0 commit comments