wireguard-dashboard-admin/build/vite/plugin/mock.js

15 lines
346 B
JavaScript
Raw Normal View History

2022-01-08 17:20:46 +08:00
import { viteMockServe } from 'vite-plugin-mock'
export function configMockPlugin(isBuild) {
return viteMockServe({
ignore: /^\_/,
mockPath: 'mock',
localEnabled: !isBuild,
prodEnabled: isBuild,
injectCode: `
import { setupProdMockServer } from '../mock/_createProdServer';
setupProdMockServer();
`,
})
}