rollup-plugin-visualizer icon indicating copy to clipboard operation
rollup-plugin-visualizer copied to clipboard

[Bug] Exclude mismatch config with UI

Open luchillo17 opened this issue 4 months ago • 2 comments

In basic terms, this works in the UI, but when the exclude filters are provided through the Vite config, nothing happens:

  • This in the UI exclude input works **/node_modules/date-fns/**,**/node_modules/lodash-es/**,**/node_modules/lucide-react/**.
  • This in the vite plugin's config doesn't work:
  plugins: [
    tailwindCSS(),
    react(),
    tsconfigPaths(),
    ...prodOnlyPlugins,
    // unusedCode({
    //   patterns: ['src/**/*.*'],
    //   exclude: [
    //     'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
    //     '**/schema/**',
    //     'src/components/ui/**',
    //   ],
    //   exportJSON: true,
    // }),
    visualizer({
      open: true,
      template: 'network',
      exclude: [
        { file: '**/node_modules/date-fns/**' },
        { file: '**/node_modules/lodash-es/**' },
        { file: '**/node_modules/lucide-react/**' },
      ],
    }),
  ],

vite.config.ts

stats.html

luchillo17 avatar Aug 27 '25 23:08 luchillo17

Thank you for details. I will take a look when will find time. Initial expectation should be that they do the same (UI and CLI/plugin options).

btd avatar Sep 03 '25 16:09 btd

I know there is difference between applying filter in UI and when plugin generate it. Ideally would be nice to have complete repro case.

What would help is generate 'raw-data' template with and without filter

btd avatar Sep 06 '25 12:09 btd