web-infra-dev/rsdoctor

[Bug]: Duplicate packages analysis is inaccurate

Closed this issue · 1 comments

Version

System:
    OS: macOS 13.6.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.16 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 120.0.6099.234
    Safari: 16.6
  npmPackages:
    @rsdoctor/rspack-plugin: 0.1.0-beta => 0.1.0-beta

Details

Duplicate packages analysis is inaccurate:

  • /Users/Project/rsbuild/node_modules/.pnpm/@rspack+plugin-react-refresh@0.5.0_react-refresh@0.14.0/node_modules/@rspack
  • /Users/Project/rsbuild/node_modules/.pnpm/react-refresh@0.14.0/node_modules/react-refresh

image

@rspack+plugin-react-refresh@0.5.0 should be detected as react-refresh

Reproduce link

https://github.com/web-infra-dev/rsbuild/tree/main/examples/react

Reproduce Steps

// rsbuild.config.ts
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';

export default defineConfig({
  plugins: [pluginReact()],
  tools: {
    rspack: {
      plugins: [
        new RsdoctorRspackPlugin({
          // Details of the plugin's options are provided below.
          disableClientServer: !!process.env.DISABLE_CLIENT_SERVER,
        }),
      ],
    },
  },
});
  • pnpm run dev

Also reproduced for react and */react packages ($package_name and */$package_name)

Screenshot 2024-01-25 at 13 21 43
Screenshot 2024-01-25 at 13 21 36