rsnext/packages
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
..
create-next-app v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
eslint-config-next v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
eslint-plugin-next fix(eslint): allow <img> in conjunction with <picture> (#37504) (#37570) 2022-06-15 21:13:52 -05:00
next Add images.unoptimized: true for easy next export (#37698) 2022-06-16 20:20:17 +00:00
next-bundle-analyzer v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-codemod v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-env v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-mdx v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-plugin-storybook v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-polyfill-module v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-polyfill-nomodule v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
next-swc v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
react-dev-overlay v12.1.7-canary.40 2022-06-15 14:40:38 -05:00
react-refresh-utils v12.1.7-canary.40 2022-06-15 14:40:38 -05:00