Skip to content

Commit

Permalink
chore: try fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 25, 2021
1 parent 6edb3aa commit a515786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ export function getWebpackPlugin<UserOptions = {}> (
apply (resolver: Resolver) {
const target = resolver.ensureHook('resolve')
const tap = () => async (request: ResolveRequest, resolveContext: any, callback: any) => {
// filter out invalid requests
if (!request.request || request.request.startsWith(plugin.__virtualModulePrefix)) {
if (!request.request) {
return callback()
}

const id = slash(request.request)

// filter out invalid requests
if (id.startsWith(plugin.__virtualModulePrefix)) {
return callback()
}

// call hook
const result = await plugin.resolveId!(id)
if (result == null) {
Expand Down

0 comments on commit a515786

Please sign in to comment.