rsnext/docs
Steven 25efdfad36
Add support for output: export config (#46744)
## Background

In the early days, `next export` was created when Next.js was SSR-only in order to statically export your pages for self hosting where no server was available. However, around the time `getStaticProps()` and `getStaticPaths()` were introduced, Next.js began [automatically generating static pages](https://nextjs.org/docs/advanced-features/automatic-static-optimization) (SSG first and SSR opt-in) during `next build`. This meant there were very few reasons to use `next export` and it started to become a stale feature.

## Problem We Need To Solve

Users targeting `next export` currently have a really bad experience. They start a new project and use all the features Next.js has to offer because they all features work with `next dev`. Then when development is finished and it comes time to deploy, running `next build && next export` will fail with errors for [unsupported features](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features).

## Solution

This PR introduces a new configuration option, `output: 'export'`, to indicate that the user intends to run `next export`.

With this change, Next.js can fail fast during `next dev` if any [unsupported features](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features) are used, thereby improving developer experience with instant feedback.


```js
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  output: 'export',
}

module.exports = nextConfig
```
2023-03-04 00:46:20 +00:00
..
advanced-features Add support for output: export config (#46744) 2023-03-04 00:46:20 +00:00
api-reference Fix the doc on how to use the turbo loader in option-less format (#46665) 2023-03-02 06:40:50 +00:00
api-routes feat: enables 'edge' as a possible runtime for API routes (#44045) 2022-12-15 10:08:03 +01:00
basic-features Update script.md (#46680) 2023-03-02 16:26:03 +00:00
guides Update building-forms.md (#44862) 2023-01-13 14:34:55 -08:00
migrating docs(migrating): fix broken react-router link (#43843) 2022-12-08 10:28:36 -08:00
routing fixed missing <Link /> keyword (#42422) 2022-11-03 11:07:01 -07:00
accessibility.md Add documentation on accessibility. (#38522) 2022-07-14 13:05:39 +00:00
authentication.md Alphabetize auth docs providers. (#34281) 2022-02-13 00:51:53 +00:00
deployment.md Docs: Fix Railway link (#46381) 2023-02-24 20:01:14 +00:00
faq.md doc: improve a word client side rendering (#39771) 2022-08-22 14:55:46 -05:00
getting-started.md Update getting-started documentation (#45284) 2023-01-26 01:25:42 +00:00
going-to-production.md chore: fix docs link to minimumCacheTTL (#45502 2023-02-01 17:31:35 -08:00
manifest.json chore(docs): add snippets for common image loaders (#46647) 2023-03-01 17:19:28 -05:00
testing.md [next/jest] Support path aliases from tsconfig/jsconfig (#45815) 2023-03-01 10:52:32 +01:00
upgrading.md Docs: next/font updates (#46159) 2023-02-24 05:20:26 +00:00