Robinson recommends Now, made by Zeit, for its automatic framework detection, command line deployment, and Git hosting integrations. He also recommends Netlify, citing its interface and pricing, while saying he prefers Now.
Exporting & Deployment
Speaker
Lee Robinson, a developer educator at Vercel, explains how to export and deploy Next.js applications using Now and Netlify.
Pages without `getInitialProps` can be statically pre-rendered for faster page loads. Robinson describes `next export` as a way to produce standalone static HTML in an `out` folder, which his team copied into an existing .NET application to ship a feature quickly. For most projects, he favors `next build`, which supports static pages and API routes.
Robinson demonstrates pushing a branch to GitHub and opening a pull request. Now automatically deploys a preview at a unique URL, so teammates and stakeholders can review changes before production. The workflow can also show deployment logs and run linting and tests.
A `now.json` file can set the project name, domain aliases, build settings, and routes; Robinson uses routes to control caching of assets. He also describes uploading Firebase and Mailchimp secrets for use through `process.env`, and adding a 301 redirect after renaming his resume.
Takeaways
- Use static pre-rendering where possible to improve page load times.
- Choose `next export` when you need standalone HTML that can be copied into an existing application.
- Use pull request previews to review deployed changes before merging to production.
- Keep service credentials out of client code and provide them through environment variables.
- Add redirects when URLs change so existing links continue to work.
Mentioned in this talk
Search inside this talk
What was claimed 11
- feature
Vercel: Zero-configuration deployment
“deploy applications with zero configuration”
YouTube Unverified1 source· Talk
- built
“Zeit, which makes Next.js”
YouTube Verified2 sources· Talk
- built
“Now, made by Zeit”
YouTube Unverified1 source· Talk
- integrates with
“It integrates with ... Bitbucket”
YouTube Unverified1 source· Talk
- integrates with
“It integrates with ... GitLab”
YouTube Unverified1 source· Talk
- integrates with
“It integrates with GitHub”
YouTube Unverified1 source· Talk
- featureNetlify: Identity analytics
“I actually like their identity analytics a lot”
YouTube Unverified1 source· Talk
- feature
Next.js: `next export` outputs static HTML in an `out` folder that can run without a Node.js server
“This exports to an `out` folder and renders completely static HTML”
YouTube Unverified1 source· Talk
Related talks
32:32
9:48
26:06
14:29
12:33
32:57