rsnext/packages/next
Steven b7d057453d
Add images.unoptimized: true for easy next export (#37698)
In a previous PR (#19032), we added a hard error during `next export` if the default Image Optimization API is being used because it requires a server to optimized on demand. The error message offers several different solutions but it didn't consider that by the time someone runs `next export`, they are probably done writing their app.

So if `next export` is a hard requirement, the quickest path forward is to disable Image Optimization API. So this PR adds a new configuration option to `next.config.js`:

```js
module.exports = {
  images: {
    unoptimized: true
  }
}
```

### Update
Upon further discussion, we might want to avoid doing this just for images and instead introduce a top-level config to indicate export is coming and then handle errors or warn for [unsupported features](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features).

```
module.exports = {
  nextExport: true
}
```

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-06-16 20:20:17 +00:00
..
bin Fix react root env missing in NextServer (#37562) 2022-06-09 15:43:38 +02:00
build Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
bundles update webpack (#35867) 2022-04-07 16:00:26 +00:00
cli fix: should listen for config file changes when specifying the app directory (#36570) 2022-05-22 19:42:53 +00:00
client Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
compiled Update pre-compiled (#37729) 2022-06-15 20:51:51 +00:00
export Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
image-types Don't import internally from types in next-env.d.ts (#34394) 2022-02-19 04:25:49 +01:00
lib Update matched path params priority (#37646) 2022-06-13 13:34:08 +00:00
pages chore: remove unused safari nomodule fix (#37541) 2022-06-08 11:56:15 +00:00
server Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
shared/lib Ensure rewrite query params with middleware are available in router (#37724) 2022-06-15 14:32:44 -05:00
telemetry Telemetry: track usage of 'experimental/nextScriptWorkers' (#36812) 2022-05-11 19:18:44 +00:00
trace Small code improvements (#37227) 2022-05-26 23:19:47 +00:00
types Update to leverage turbo for build/prepublish (#37280) 2022-05-30 19:05:27 -05:00
amp.d.ts
amp.js
app.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
app.js
babel.d.ts
babel.js
client.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
client.js
config.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
config.js
constants.d.ts
constants.js
data.d.ts
data.js
data.sqlite
document.d.ts Fix document type import path (#32117) 2021-12-04 10:23:15 +00:00
document.js
dynamic.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
dynamic.js
error.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
error.js
head.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
head.js fix(#36435): apply correct fix (#36464) 2022-04-26 11:15:49 -05:00
image.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
image.js
index.d.ts Include submodules in exported type definition (#28316) 2021-11-26 14:46:56 +01:00
jest.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
jest.js fix(#36534): enable interopClientDefaultExport for next/jest (#36824) 2022-05-11 13:13:13 -05:00
license.md Update license year 2022-01-13 16:02:34 +01:00
link.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
link.js
package.json v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
README.md
router.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
router.js
script.d.ts Improve exported root definitions (#32077) 2021-12-03 07:16:29 +00:00
script.js
server.d.ts Middleware: remove req.ua (#37512) 2022-06-09 11:10:21 +00:00
server.js Middleware: remove req.ua (#37512) 2022-06-09 11:10:21 +00:00
streaming.d.ts Group streaming experimental apis (#33878) 2022-02-02 13:42:14 +00:00
streaming.js Group streaming experimental apis (#33878) 2022-02-02 13:42:14 +00:00
taskfile-ncc.js Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
taskfile-swc.js Fix interopDefault on jest object-proxy (#37002) 2022-05-18 09:41:13 +00:00
taskfile.js Upgrade node-html-parser (#37449) 2022-06-06 15:36:29 -04:00
tsconfig.json Integrate tsec into the linting process (#33746) 2022-02-24 16:59:18 -08:00

Next.js

Getting Started

Visit https://nextjs.org/learn to get started with Next.js.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Who is using Next.js?

Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.

Community

The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members you can join the Next.js Discord.

Our Code of Conduct applies to all Next.js community channels.

Contributing

Please see our contributing.md.

Good First Issues

We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Authors