Plugin API | Vite
Vite plugins extends Rollup's well-designed plugin interface with a few extra Vite-specific options. As a result, you can write a Vite plugin once and have it work for both dev and build. It is recommended to go through Rollup's plugin documentation first before reading the sections below.
https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention