-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add sideeffects: false to package.json #197
Comments
@travigd Can you use a dynamic import instead? export async function getServerSideProps() {
const crypto = await import('crypto');
} |
Yes, but this should still be fixed. :) I'm currently just using the webpack workaround described above. |
Could probably integrate this into PR #200 tbh. Will here shortly |
Probably best not to conflate multiple things in the same PR. |
Would it be best to rather make a separate PR after #200 is pushed to have this fixed? |
I'd think so. |
PR #201 will fix this issue |
Fixed in b638139 |
glad you got around to it thanks :) |
See title.
Allows for deadcode elimination when not the module is imported but not actually used.
This comes up for me when using NextJS where one frequently writes server side code as a
getServerSideProps
function. I want to import Node's crypto module but don't need it for the browser -- but webpack is unable to remove the import even though Next does remove thegetServerSideProps
function).The workaround is to add
to the webpack config.
The text was updated successfully, but these errors were encountered: