Skip to content

Commit

Permalink
fix: unexpected token 'export' in load **.d.ts file in prod mode (#2185)
Browse files Browse the repository at this point in the history
Co-authored-by: ernan <xx@ernan.com>
  • Loading branch information
liaojiankai and ernan committed Aug 1, 2022
1 parent 3668748 commit 6d634ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/common/dataSourceManager.ts
Expand Up @@ -8,7 +8,7 @@ import { join } from 'path';
import { Types } from '@midwayjs/decorator';

const DEFAULT_PATTERN = ['**/**.ts', '**/**.js'];

const IGNORE_PATTERN = ['**/**.d.ts'];
export abstract class DataSourceManager<T> {
protected dataSource: Map<string, T> = new Map();
protected options = {};
Expand Down Expand Up @@ -121,6 +121,7 @@ export function globModels(globString: string, appDir: string) {
// string will be glob file
const files = run(DEFAULT_PATTERN, {
cwd,
ignore: IGNORE_PATTERN,
});
for (const file of files) {
const exports = require(file);
Expand Down

0 comments on commit 6d634ce

Please sign in to comment.