Skip to content

Commit

Permalink
feat(cli): allow 'export default' style TS config files (#4031)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored Jan 8, 2021
1 parent 57adf84 commit 9393667
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ async function loadExtConfigTS(
}

const ts = require(tsPath); // eslint-disable-line @typescript-eslint/no-var-requires
const extConfigObject = requireTS(ts, extConfigFilePath) as any;
const extConfig = extConfigObject.default ?? extConfigObject;

return {
extConfigType: 'ts',
extConfigName,
extConfigFilePath: extConfigFilePath,
extConfig: requireTS(ts, extConfigFilePath) as any,
extConfig,
};
} catch (e) {
if (!isFatal(e)) {
Expand Down

0 comments on commit 9393667

Please sign in to comment.