15 lines
364 B
JavaScript
15 lines
364 B
JavaScript
|
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
||
|
|
||
|
const modules = import.meta.globEager('./**/*.js')
|
||
|
const mockModules = []
|
||
|
Object.keys(modules).forEach((key) => {
|
||
|
if (key.includes('/_')) {
|
||
|
return
|
||
|
}
|
||
|
mockModules.push(...modules[key].default)
|
||
|
})
|
||
|
|
||
|
export function setupProdMockServer() {
|
||
|
createProdMockServer(mockModules)
|
||
|
}
|