ericclemmons / click-to-component

Option+Click React components in your browser to instantly open the source in VS Code
MIT License
1.94k stars 75 forks source link

Production build still contains un-used bundle #54

Open thanhlmm opened 2 years ago

thanhlmm commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Add analyze package
  2. Build for Analyze

Expected behavior There shouldn't be @floating-ui here.

I would suggest turn on sideEffect=false to support tree sharking

Screenshots

Screen Shot 2022-06-14 at 5 22 21 PM

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

iamyoki commented 2 years ago

I met this problem as well, my temp solution is this

const DevClickToComponent =
  process.env.NODE_ENV === 'development'
    ? require('click-to-react-component').ClickToComponent
    : () => null;
<DevClickToComponent />