The default build of Jimp only includes image formats written in javascript.
To utilize webp (and anything else we don’t have a JS implementation for) we need to use format plugins and create a custom jimp.
Full code for example
Browser Usage
Since you’re no longer using a pre-bundled version of jimp you need configure your bundler to handle the node code.
For example in vite/astro you can use vite-plugin-node-polyfills.