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

Compile away next/link proptypes in production #5155

Merged

Conversation

timneutkens
Copy link
Member

This saves 7KB as prop-types-exact is not needed in production.

Copy link
Contributor

@HaNdTriX HaNdTriX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix somehow only works in devmode. In production I get the warning:

Error: Cannot find module 'prop-types-exact'

My fault. I forgot to run yarn 😬

@Florian-R
Copy link

Just curious, any reason to not use transform-react-remove-prop-types instead?

@timneutkens
Copy link
Member Author

Just curious, any reason to not use transform-react-remove-prop-types instead?

We already do, but Next.js doesn't run babel over node_modules, so they're only removed from your own code.

@timneutkens timneutkens merged commit 695f372 into vercel:canary Sep 14, 2018
@timneutkens timneutkens deleted the fix/remove-proptypes-exact-production branch September 14, 2018 09:34
@timneutkens
Copy link
Member Author

@dzienisz what's the reason for 👎?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants