rsnext/test/integration/export-image-loader
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
..
pages Rename next/image dangerously-unoptimized to custom and warn when applicable (#26998) 2021-07-08 19:35:19 +00:00
test Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
next.config.js Add dangerously-unoptimized loader for next/image (#26847) 2021-07-07 15:20:16 -05:00