Skip to content

Commit 81a02b9

Browse files
committedSep 29, 2021
fix(tsbb): fix the issue of watch path resolve.
1 parent 9fcfcb5 commit 81a02b9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎packages/tsbb/src/utils/watchCompile.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export async function watchCompile(
3535
const output = filepath.replace(entryDir, esm);
3636
if (
3737
!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'])
4040
) {
4141
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'])) {
4343
const result = ts.sys.readFile(filepath);
4444
outputFiles(output, result);
4545
}
@@ -48,11 +48,11 @@ export async function watchCompile(
4848
const output = filepath.replace(entryDir, cjs);
4949
if (
5050
!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'])
5353
) {
5454
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'])) {
5656
const result = ts.sys.readFile(filepath);
5757
outputFiles(output, result);
5858
}

0 commit comments

Comments
 (0)
Please sign in to comment.