1

I just started using Snowpack for a React/Typescript project and initialized it with: https://www.npmjs.com/package/@snowpack/app-template-react-typescript. It looks very promising but I get an error [@snowpack/plugin-typescript] Cannot find module '../../dummy.webp or its corresponding type declarations when trying to import a .webp image. Somebody an idea how to get it working without using @ts-ignore?

Jonathan
  • 517
  • 1
  • 6
  • 12

1 Answers1

1

Just found the solution. You need to add the following lines in types/static.d.ts:

declare module '*.webp' {
  const ref: string;
  export default ref;
}
Jonathan
  • 517
  • 1
  • 6
  • 12