You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is probably worth refactoring the createPluginCallback to return the ResolveRequest object.
Only path looks required. Would the current returned string easily convert to { path: currentString } ?
Next steps
When the ResolvePluginInstance type is exported from webpack. This should result in this line:
The Resolver type should be imported from webpack and replace the current Resolver interface.
Legacy support should just be done via NPM versions. If someone wants to fall back to Webpack 4 or earlier, they can grab an earlier release?
If there is a desire for legacy support, renaming most of the current types with a Legacy prefix would keep the namespace clear.
There is another type that will be needed. The FileSystem from webpack. I'm looking to add it to a PR. But it is accessible via type FileSystem = Request["fileSystem"]. Annoying, but accessible.
The text was updated successfully, but these errors were encountered:
Just creating a ticket here to remember.
Possible Issue with createPluginCallback
Problem: Callback typing is currently
string
when webpack 5 is now expectingnull | ResolveRequest
The
getHook()
method on the resolver returns:When we call tapAsync, the cast function looks roughly like this:
Currently, the function
createPluginCallback
has cast a callback with this:Current status
It seems to be working fine currently.
Future Needs
It seems that to write proper plugins, there will need to have some way of getting to
ResolveRequest
andResolveContext
types.ResolveRequest
These types are a match from the module
enhanced-resolve
and might just be auto-generating.It is probably worth refactoring the
createPluginCallback
to return theResolveRequest
object.Only
path
looks required. Would the current returned string easily convert to{ path: currentString }
?Next steps
When the
ResolvePluginInstance
type is exported from webpack. This should result in this line:The
Resolver
type should be imported fromwebpack
and replace the current Resolver interface.Legacy support should just be done via NPM versions. If someone wants to fall back to Webpack 4 or earlier, they can grab an earlier release?
If there is a desire for legacy support, renaming most of the current types with a
Legacy
prefix would keep the namespace clear.There is another type that will be needed. The
FileSystem
from webpack. I'm looking to add it to a PR. But it is accessible viatype FileSystem = Request["fileSystem"]
. Annoying, but accessible.The text was updated successfully, but these errors were encountered: