14 lines
313 B
JavaScript
14 lines
313 B
JavaScript
import { viteMockServe } from 'vite-plugin-mock'
|
|
|
|
export function configMockPlugin(isBuild) {
|
|
return viteMockServe({
|
|
mockPath: 'mock/api',
|
|
localEnabled: !isBuild,
|
|
prodEnabled: isBuild,
|
|
injectCode: `
|
|
import { setupProdMockServer } from '../mock';
|
|
setupProdMockServer();
|
|
`,
|
|
})
|
|
}
|