fwouts/viteshot

NextJs 'next/image' support

marcoNonvanilla opened this issue · 2 comments

Viteshot does not fully support NextJs. Things like next image currently don't work.

our testable components which use next/image are configured this way:

import * as NextImage from 'next/image';
const OriginalNextImage = NextImage.default;

if (process.env.TEST_ENV === 'vreg') {
  Object.defineProperty(NextImage, 'default', {
    configurable: true,
    value: (props) => (
      <OriginalNextImage {...props} unoptimized loader={({ src }) => src} />
    ),
  });
}