15 lines
346 B
JavaScript
15 lines
346 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/_createProdServer';
|
|
setupProdMockServer();
|
|
`,
|
|
})
|
|
}
|