Skip to content

Commit

Permalink
Merge pull request #347 from Codex-/cfg_ts_loader
Browse files Browse the repository at this point in the history
Fix: Use rewritten cosmiconfig-typescript-loader package for handling TS config files.
  • Loading branch information
patricklafrance authored Dec 9, 2021
2 parents e90069a + 8ff0b64 commit ab22104
Show file tree
Hide file tree
Showing 3 changed files with 22,753 additions and 72 deletions.
9 changes: 2 additions & 7 deletions packages/craco/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { cosmiconfigSync } = require("cosmiconfig");
const { get } = require("lodash");
const { default: tsLoader } = require("cosmiconfig-typescript-loader");

const path = require("path");

Expand Down Expand Up @@ -41,12 +41,7 @@ const explorer = cosmiconfigSync(moduleName, {
`.${moduleName}rc`
],
loaders: {
".ts": filePath => {
require("ts-node/register");
const result = require(filePath);

return get(result, "default", result);
}
".ts": tsLoader()
}
});

Expand Down
Loading

0 comments on commit ab22104

Please sign in to comment.