Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit f14eaab

Browse files
committed
fix(paths-plugin): properly skip .d.ts files
1 parent 60ffa3c commit f14eaab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/paths-plugin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,17 @@ export class PathPlugin implements ResolverPlugin {
116116
}
117117

118118
mappings.forEach(mapping => {
119-
if (mapping.target.indexOf('@types') === -1) {
120-
// skip "phantom" type references
119+
// skip "phantom" type references
120+
if (!this.isTyping(mapping.target)) {
121121
resolver.plugin(this.source, this.createPlugin(resolver, mapping));
122122
}
123123
});
124124
}
125125

126+
isTyping(target: string) {
127+
return target.indexOf('@types') !== -1 || target.indexOf('.d.ts') !== -1;
128+
}
129+
126130
createPlugin(resolver: Resolver, mapping: Mapping) {
127131
return (request, callback) => {
128132
let innerRequest = getInnerRequest(resolver, request);

0 commit comments

Comments
 (0)