wireguard-dashboard-admin/build/plugin/mock.js
2022-05-03 22:37:51 +08:00

15 lines
348 B
JavaScript

import { viteMockServe } from 'vite-plugin-mock'
export function configMockPlugin(isBuild) {
return viteMockServe({
ignore: /^\_/,
mockPath: 'mock',
localEnabled: !isBuild,
prodEnabled: isBuild,
injectCode: `
import { setupProdMockServer } from '../mock/_create-prod-server';
setupProdMockServer();
`,
})
}