Closed ArielGueta closed 2 years ago
Can you share a repro? I have a react publishable lib as well and don't have this issue.
@danr-za create a new workspace, choose the npm
option. Then, install nrwl/react
, create a new publishable
and buildable
library, export a dummy hook, and build it.
I now see that it happens only when using features like spread. It seems that it adds polyfills and I don't understand why. My target is "target": "ES2017",
Ok, I figured it out. When creating npm
workspace or a react library
it doesn't create the .browserslistrc
file for modern browsers. Therefore it uses IE11 and includes the polyfills.
I solved it by creating it manually and used the same config from here:
https://nx.dev/l/r/guides/browser-support
But I'm expecting it to be consistent and create it for me. Other developers maybe will not notice this, and include polyfills for nothing.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
I'm creating a react buildable and publishable React library, and when I build it, it adds many unrelated code to the bundle: