fix module resolution when path has a `#` (fixes #331)

master
Brad Cornes 2021-05-20 17:04:32 +01:00
parent b7bf51f156
commit e2922837b1
1 changed files with 2 additions and 1 deletions

View File

@ -22,5 +22,6 @@ export function setPnpApi(pnpApi: any): void {
export default function resolveFrom(from?: string, id?: string): string { export default function resolveFrom(from?: string, id?: string): string {
let result = resolver.resolveSync({}, from, id) let result = resolver.resolveSync({}, from, id)
if (result === false) throw Error() if (result === false) throw Error()
return result // https://github.com/webpack/enhanced-resolve/issues/282
return result.replace(/\0#/g, '#')
} }