27 lines
758 B
JavaScript
27 lines
758 B
JavaScript
/*
|
|
* @Descripttion:
|
|
* @version:
|
|
* @Date: 2021-04-20 11:06:21
|
|
* @LastEditors: huzhushan@126.com
|
|
* @LastEditTime: 2021-04-21 09:47:28
|
|
* @Author: huzhushan@126.com
|
|
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
|
|
* @Github: https://github.com/huzhushan/vue3-element-admin
|
|
* @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
|
|
*/
|
|
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
|
|
|
const modules = import.meta.globEager('./**/*.js')
|
|
|
|
const mockModules = []
|
|
Object.keys(modules).forEach(key => {
|
|
mockModules.push(...modules[key].default)
|
|
})
|
|
|
|
/**
|
|
* Used in a production environment. Need to manually import all modules
|
|
*/
|
|
export function setupProdMockServer() {
|
|
createProdMockServer(mockModules)
|
|
}
|