docs: improve local development instructions - #133
Conversation
Signed-off-by: JD De Dios Ojeda <89946133+ojedaJD@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
avivkeller
left a comment
There was a problem hiding this comment.
This doesn't resolve the mentioned issue
|
agree with aviv but the content is better IMO |
Signed-off-by: JD De Dios Ojeda <89946133+ojedaJD@users.noreply.github.com>
|
Thanks for the feedback! I updated the PR to fix the underlying issue. Local builds now use localhost for asset URLs, while preview and production builds keep their existing URLs. I tested the local build, and everything loads correctly. |
| ? `https://${process.env.VERCEL_URL}` | ||
| : process.env.VERCEL_ENV === 'production' | ||
| ? 'https://nodejs.org' | ||
| : 'http://localhost:3000'; |
There was a problem hiding this comment.
Port 3000 can be taken... The thing is that this is defined at build-time... So nothing that can really be done, although it'd be cool if this port could be overridden. Although I doubt that many people will run this locally in a way that this could be a problem.
| This repository requires Node.js 24. Install the dependencies and generate the | ||
| static site: |
There was a problem hiding this comment.
It requires the latest LTS, not Node.js 24
|
I don't think this is an improvement, it's just rewording for the sake of rewording |
bmuenzenmeyer
left a comment
There was a problem hiding this comment.
I don't think this is an improvement, it's just rewording for the sake of rewording
It absolutely is an improvement, especially the mention to serve and the localhost origin. The referenced issues came out directly from sitting with a Code and Learn attendee that tripped up on these two points.
The comment about Node 24 is valid and should be normalized.
|
|
||
| ## Building locally | ||
|
|
||
| This repository requires Node.js 24. Install the dependencies and generate the |
There was a problem hiding this comment.
| This repository requires Node.js 24. Install the dependencies and generate the | |
| This repository requires the Node.js version specified in the [.nvmrc file](https://github.com/nodejs/learn/blob/main/.nvmrc). Install the dependencies and generate the |
| Use Node.js 24, install the dependencies, and build the static site: | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run build # generates static site + Orama search DB in out/ | ||
| npm run build | ||
| npx serve out | ||
| ``` | ||
|
|
||
| The build generates the static site and Orama search database in `out/`. | ||
| After starting the server, open <http://localhost:3000/learn>. Rebuild the site | ||
| after making changes to preview the updated content. | ||
|
|
||
| ## Contributing |
There was a problem hiding this comment.
Delete all this and defer to CONTRIBUTING.md for a single source.
| Use Node.js 24, install the dependencies, and build the static site: | |
| ```bash | |
| npm install | |
| npm run build # generates static site + Orama search DB in out/ | |
| npm run build | |
| npx serve out | |
| ``` | |
| The build generates the static site and Orama search database in `out/`. | |
| After starting the server, open <http://localhost:3000/learn>. Rebuild the site | |
| after making changes to preview the updated content. | |
| ## Contributing |
Refs #127 and #128.
Documents the Node.js 24 requirement, static build steps, local serving command, preview URL, and rebuild workflow. Local builds now generate localhost asset URLs while Vercel preview and production builds retain their deployment origins.