-
-
Notifications
You must be signed in to change notification settings - Fork 86
feat: supprot rspack's resolver analysis #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rsdoctor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the resolver plugin implementation by moving it from webpack-specific code to a shared core module to support both Webpack and Rspack. The key change is consolidating the resolver logic into a reusable base implementation.
- Moved
InternalResolverPluginfrompackages/webpack-plugin/src/plugins/resolver.tstopackages/core/src/inner-plugins/plugins/resolver.ts - Updated Webpack and Rspack plugins to import from the new location and use proper type parameters
- Fixed import paths in types package to use relative imports instead of path aliases
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/webpack-plugin/src/plugins/resolver.ts | Deleted the webpack-specific resolver plugin implementation |
| packages/webpack-plugin/src/plugin.ts | Updated to import InternalResolverPlugin from core and added type parameter <Compiler> |
| packages/rspack-plugin/src/plugin.ts | Added import and instantiation of InternalResolverPlugin with proper type parameter |
| packages/core/src/inner-plugins/plugins/resolver.ts | Added new shared resolver plugin implementation using normalModuleFactory hooks |
| packages/core/src/inner-plugins/plugins/index.ts | Exported the new resolver plugin |
| packages/types/src/sdk/instance.ts | Fixed import paths from aliases to relative paths |
| packages/types/src/plugin/rspack.ts | Added new Rspack-specific type definitions for resolver implementation |
| examples/rsbuild-minimal/rsbuild.config.ts | Enabled resolver feature and commented out brief mode config for testing |
| examples/modern-minimal/modern.config.ts | Added 'resolver' to features array to enable resolver functionality |
Comments suppressed due to low confidence (1)
packages/rspack-plugin/src/plugin.ts:170
- Duplicate condition checking
this.options.features.resolver. The second block (lines 164-170) will always execute if the first block (lines 158-162) executes, but logs that Rspack doesn't support resolver capabilities immediately after instantiating the resolver plugin. Either remove the plugin instantiation or remove the warning message, as they contradict each other.
if (this.options.features.resolver) {
new InternalResolverPlugin<Plugin.BaseCompilerType<'rspack'>>(
this,
).apply(compiler);
}
if (this.options.features.resolver) {
logger.info(
chalk.yellow(
'Rspack currently does not support Resolver capabilities.',
),
);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e11a393 to
ee538d6
Compare
4e44737 to
4bb0a37
Compare
Summary
Related Links