rsnext/test/integration/next-image-legacy
Laityned 369d6b76c4
Imageloader: collect images serverside to include images from staticp… (#41554)
In #41548, I show that I would like to provide an object with images in
getStaticProps. The StaticImageData is parsed correctly and provided as
a prop to the page. Nonetheless, the image is not available in the
static directory. Therefore the image is not shown. This is also
addressed in issue #29571. The underlying cause is that the import of
the image is removed from the client bundle and only present in the
server bundle.

Evaluating the next-image-loader shows that the file is only placed in
the static directory if emitted from the client bundle by firing
this.emitFile. By changing this to only emitting the file from the
serverside bundle in the webpackloader, static images loaded in the
getStaticProps are made available properly as well as images directly
used in componts (so present in server and client bundle).

This would PR would prevent the circumventing solution which enforces
that the StaticImageData should be present in the client side bundle
while it will also be present in the staticprops.

<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`


Closes #42783, Fixes #42443

Co-authored-by: Diederik <diederik@digitalpatrol.nl>
2022-11-23 09:28:53 -05:00
..
asset-prefix
base-path BREAKING CHANGE: Remove target: serverless (#41495) 2022-10-18 09:47:13 -07:00
basic BREAKING CHANGE: Enable newNextLinkBehavior (#41459) 2022-10-17 21:20:28 -04:00
custom-resolver BREAKING CHANGE: Enable newNextLinkBehavior (#41459) 2022-10-17 21:20:28 -04:00
default Imageloader: collect images serverside to include images from staticp… (#41554) 2022-11-23 09:28:53 -05:00
image-from-node-modules
no-intersection-observer-fallback BREAKING CHANGE: Enable newNextLinkBehavior (#41459) 2022-10-17 21:20:28 -04:00
noscript
react-virtualized
svgo-webpack
trailing-slash
typescript
unicode
unoptimized