File tree 2 files changed +7
-1
lines changed
packages/graphql-codegen-cli/src
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @graphql-codegen/cli ' : patch
3
+ ---
4
+
5
+ Use ` fs.statSync ` when creating custom require instead of ` path.extname `
Original file line number Diff line number Diff line change @@ -15,12 +15,13 @@ import { getPresetByName } from './presets';
15
15
import { debugLog } from './utils/debugging' ;
16
16
import { printSchemaWithDirectives } from '@graphql-tools/utils' ;
17
17
import { CodegenContext , ensureContext } from './config' ;
18
+ import fs from 'fs' ;
18
19
import path from 'path' ;
19
20
// eslint-disable-next-line
20
21
import { createRequire , createRequireFromPath } from 'module' ;
21
22
22
23
const makeDefaultLoader = ( from : string ) => {
23
- if ( ! path . extname ( from ) ) {
24
+ if ( fs . statSync ( from ) . isDirectory ( ) ) {
24
25
from = path . join ( from , '__fake.js' ) ;
25
26
}
26
27
You can’t perform that action at this time.
0 commit comments