You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
364B

  1. import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
  2. const modules = import.meta.globEager('./**/*.js')
  3. const mockModules = []
  4. Object.keys(modules).forEach((key) => {
  5. if (key.includes('/_')) {
  6. return
  7. }
  8. mockModules.push(...modules[key].default)
  9. })
  10. export function setupProdMockServer() {
  11. createProdMockServer(mockModules)
  12. }