Skip to content

Commit 6bbe1cd

Browse files
committed
fix last test
1 parent e2c212a commit 6bbe1cd

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/transpilation/resolve.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ResolutionResult {
2727
}
2828

2929
class ResolutionContext {
30-
private noResolvePaths: RegExp[];
30+
private noResolvePaths: picomatch.Glob[];
3131

3232
public diagnostics: ts.Diagnostic[] = [];
3333
public resolvedFiles = new Map<string, ProcessedFile>();
@@ -38,9 +38,7 @@ class ResolutionContext {
3838
private readonly emitHost: EmitHost,
3939
private readonly plugins: Plugin[]
4040
) {
41-
const unique = [...new Set(options.noResolvePaths)];
42-
const matchers = unique.map(x => picomatch.makeRe(x));
43-
this.noResolvePaths = matchers;
41+
this.noResolvePaths = [...new Set(options.noResolvePaths)];
4442
}
4543

4644
public addAndResolveDependencies(file: ProcessedFile): void {
@@ -73,7 +71,7 @@ class ResolutionContext {
7371
return;
7472
}
7573

76-
if (this.noResolvePaths.find(isMatch => picomatch.test(required.requirePath, isMatch))) {
74+
if (this.noResolvePaths.find(glob => picomatch.isMatch(required.requirePath, glob))) {
7775
if (this.options.tstlVerbose) {
7876
console.log(
7977
`Skipping module resolution of ${required.requirePath} as it is in the tsconfig noResolvePaths.`

0 commit comments

Comments
 (0)