@@ -35,11 +35,11 @@ export async function watchCompile(
35
35
const output = filepath . replace ( entryDir , esm ) ;
36
36
if (
37
37
! disableBabel &&
38
- isMatch ( output , [ '**/*.[jt]s?(x)' ] ) &&
39
- ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' , '**/tsconfig.json' ] )
38
+ isMatch ( path . resolve ( output ) , [ '**/*.[jt]s?(x)' ] ) &&
39
+ ! isMatch ( path . resolve ( output ) , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' , '**/tsconfig.json' ] )
40
40
) {
41
41
transform ( filepath , { entryDir, esm, ...other } ) ;
42
- } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/tsconfig.json' , '**/*.d.ts' ] ) ) {
42
+ } else if ( ! isMatch ( path . resolve ( output ) , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/tsconfig.json' , '**/*.d.ts' ] ) ) {
43
43
const result = ts . sys . readFile ( filepath ) ;
44
44
outputFiles ( output , result ) ;
45
45
}
@@ -48,11 +48,11 @@ export async function watchCompile(
48
48
const output = filepath . replace ( entryDir , cjs ) ;
49
49
if (
50
50
! disableBabel &&
51
- isMatch ( output , [ '**/*.[jt]s?(x)' ] ) &&
52
- ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' ] )
51
+ isMatch ( path . resolve ( output ) , [ '**/*.[jt]s?(x)' ] ) &&
52
+ ! isMatch ( path . resolve ( output ) , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/*.d.ts' ] )
53
53
) {
54
54
transform ( filepath , { entryDir, cjs, ...other } ) ;
55
- } else if ( ! isMatch ( output , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/tsconfig.json' , '**/*.d.ts' ] ) ) {
55
+ } else if ( ! isMatch ( path . resolve ( output ) , [ '**/?(*.)+(spec|test).[jt]s?(x)' , '**/tsconfig.json' , '**/*.d.ts' ] ) ) {
56
56
const result = ts . sys . readFile ( filepath ) ;
57
57
outputFiles ( output , result ) ;
58
58
}
0 commit comments