-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
chore: Create a prebuild script to generate next data. #5461
chore: Create a prebuild script to generate next data. #5461
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
LGTM!
Merged this PR as it is simple enough and unblocks another PR. |
Just to double-check @Harkunwar you tested this command indeed gets invoked before build, right? |
@ovflowd Yes, I did check and it was working. I just also realized and So now it's executing twice since it's also part of the build script. Should we change the name of the script from |
I know that prebuild is a special keyword. Any script that starts with “pre” or “post” and as a suffix of another script name, will then either run before or after. My intent here was to check if the script is generating the files as expected 👀 |
I don’t get it why it would be executing twice. Where is it being invoked for the 2nd time? |
@ovflowd Yes, the files are being generated. It's being invoked twice because of this change. "build": "cross-env NODE_NO_WARNINGS=1 npm run prebuild && next build", |
Description
Currently we're generating next-data at the lint stage, which isn't the right place. This PR moves that generation to a
prebuild
stage.Related Issues
Fixes #5455
Check List
npx turbo lint
to ensure the code follows the style guide. And runnpx turbo lint:fix
to fix the style errors if necessary.npx turbo format
to ensure the code follows the style guide.npx turbo test
to check if all tests are passing, and/ornpx turbo test:snapshot
to update snapshots if I created and/or updated React Components.