Skip to content

Commit

Permalink
feat: ✨ 在扫描 src/api/modules 下的接口配置时 支持多级文件夹下的文件
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyEver committed Aug 28, 2020
1 parent 1c911df commit bb8ece7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/index.js
Expand Up @@ -3,7 +3,7 @@ import faker from 'faker/locale/zh_CN'
import { service, request, serviceForMock, requestForMock, mock } from './service'
import * as tools from './tools'

const files = require.context('./modules', false, /\.js$/)
const files = require.context('./modules', true, /\.js$/)
const generators = files.keys().map(key => files(key).default)

export default assign({}, ...map(generators, generator => generator({
Expand Down

0 comments on commit bb8ece7

Please sign in to comment.