Skip to content

Commit

Permalink
refactor: use rewritten cosmiconfig-typescript-loader package.
Browse files Browse the repository at this point in the history
- Fixes issue where incompatible module types are loaded implicitly.
  • Loading branch information
Codex- committed Nov 30, 2021
1 parent e90069a commit 8ff0b64
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 8ff0b64

Please sign in to comment.