Skip to content

Commit

Permalink
chore: loadStylableConfig return config extracted value
Browse files Browse the repository at this point in the history
  • Loading branch information
tzachbon committed Feb 21, 2022
1 parent fb81a6b commit 83e790f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/build-tools/src/load-stylable-config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import findConfig from 'find-config';

export function loadStylableConfig<T>(
context: string,
extract: (config: any) => T
): { path: string; config: T } | undefined {
export function loadStylableConfig<T>(context: string, extract: (config: any) => T): T | undefined {
const path = findConfig('stylable.config.js', { cwd: context });
let config;
if (path) {
Expand All @@ -19,10 +16,7 @@ export function loadStylableConfig<T>(
`Stylable configuration loaded from ${path} but no exported configuration found`
);
}
return {
path,
config: extract(config),
};
return extract(config);
}
return undefined;
}

0 comments on commit 83e790f

Please sign in to comment.