-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove TS types from exports when they come from node_modules #2191
Remove TS types from exports when they come from node_modules #2191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built locally and output in es/
drag and drop still has export {} from 'react-beautiful-dnd';
, but that seems harmless.
Local CRA-EUI project doesn't throw errors.
// comes from a 3rd-party library | ||
// best way to reliably check if this is | ||
// a type or value is to require the | ||
// library and check it's exports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I didn't notice any increase in build time, but I'd expect this method to take longer, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only executes for export {} from ''
statements, which we don't really do with node_modules
libraries.
We've had |
…c#2191) * Remove TS types from exports when they come from node_modules * changelog * Remove debugger statement
Summary
Fixes #2185 by filtering out non-value exports from
node_modules
during build/babel. I tested by:es
directory before-and-after this change, only components/drag_and_drop/index.js had changesnpm pack
ed version of EUI with these changesChecklist
- [ ] Checked in dark mode- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox- [ ] Props have proper autodocs- [ ] Added documentation examples- [ ] Checked for accessibility including keyboard-only and screenreader modes