Skip to content
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

Unnecessary require statement #1019

Closed
avin-kavish opened this issue Mar 28, 2020 · 3 comments · Fixed by #1029
Closed

Unnecessary require statement #1019

avin-kavish opened this issue Mar 28, 2020 · 3 comments · Fixed by #1029

Comments

@avin-kavish
Copy link
Contributor

What is the need for a require statement here? Can't we use good old ESModule imports?

const Root = require("./root").default; // eslint-disable-line global-require

@jameshadfield
Copy link
Member

Can't we use good old ESModule imports?

Probably 🤷‍♂ - I can't remember why I did this (or it may not have been me) -- please submit a PR if possible 😄

@avin-kavish
Copy link
Contributor Author

avin-kavish commented Mar 30, 2020

Yeah, I brought it up because you mention in #702 that tree-shaking may not be taking place. Files imported through require() can't be tree shaken, so I tried an import statement. But it only made a tiny difference just for that file... The rest of it seems to be tree shaken.

@raftar2097
Copy link
Contributor

cc @jameshadfield please have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants