Skip to content

Commit

Permalink
fix: fix crash due to string passed instead of Hook
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Apr 22, 2021
1 parent 573a9fc commit d8a02c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const pluginName = "ResolveTypescriptPlugin";

export default class ResolveTypescriptPlugin {
public apply(resolver: Resolver): void {
const target = "file";
resolver.ensureHook(target);
const target = resolver.ensureHook("file");
resolver.getHook("raw-file").tapAsync(pluginName, (request, resolveContext, callback) => {
const path = request.path && request.path.replace(/\.js$/, ".ts");
if (path === request.path) {
Expand Down

0 comments on commit d8a02c9

Please sign in to comment.