windicss / windicss-webpack-plugin

🍃 Windi CSS for webpack ⚡
https://windicss.org/integrations/webpack.html
79 stars 19 forks source link

Break React.Context in production build #122

Open lianghx-319 opened 1 year ago

lianghx-319 commented 1 year ago

Describe the bug In some case, this plugin break the source code, which is written by react.

Specific, when the code about React.Context included in plugin process, the behavior will change in production build. But dev mode is all find.

To Reproduce Provided later Steps to reproduce the behavior:

  1. Clone repository '...'
  2. Run '....'
  3. See error

Expected behavior I can include all source code to windicss process, don't worry about suffering crash on production deploy.

Screenshots

image

Additional context

lianghx-319 commented 1 year ago

When I compare the output between using windicss plugin and not using windicss plugin. I found that the duplicate react hook, wrapped the react context. And Provider and Consumer reference the different react context.

I built my project on debian os. node version is v14.20.0