import type { Plugin } from 'vite' ; export const mockPlugin = ( mockIgnore ) : Plugin => { return { name : 'vite-plugin-mock' , enforce : 'pre' , configureServer ( server ) { require ( 'webpack-dev-mock' ) ( server . middlewares , mockIgnore || [ ] ) ; } } ; } ;