Skip to content

Commit d630b4d

Browse files
Update config.ts
1 parent 64aa114 commit d630b4d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

plugin/src/helpers/config.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,8 @@ function loadGatsbyConfig({ gatsbyRoot }) {
7474
return {};
7575
}
7676

77-
const resolvedGatsbyConfigFile = resolveModule.sync(gatsbyConfigFile, {
78-
extensions: ['.js', '.ts'],
79-
});
80-
81-
if (!resolvedGatsbyConfigFile) {
82-
return {};
83-
}
84-
85-
// eslint-disable-next-line n/global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires
86-
return require(resolvedGatsbyConfigFile);
77+
// eslint-disable-next-line n/global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires
78+
return require(gatsbyConfigFile) as GatsbyConfig;
8779
}
8880

8981
function hasPlugin(plugins: PluginRef[], pluginName: string): boolean {

0 commit comments

Comments
 (0)