Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"cosmiconfig": "^9.0.0",
"jiti": "^1.21.6",
"jiti": "^2.5.1",
"semver": "^7.6.2"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ async function loadConfig(loaderContext, config, postcssOptions) {
if (!tsLoader) {
const opts = { interopDefault: true };

const jiti = require("jiti")(__filename, opts);
const { createJiti } = require("jiti");

tsLoader = (filepath) => jiti(filepath);
const jiti = createJiti(__filename, opts);

tsLoader = (filepath) => jiti.import(filepath, { default: true });
Copy link
Contributor Author

@askoufis askoufis Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default: true is effectively a shorthand for mod?.default ?? mod (docs). It was required to get tests passing, specifically the cts and mts config autoload tests. I'm not exactly sure why this is necessary now - perhaps due to some changes in how interopDefault works in v2.

}

loaders[".cts"] = tsLoader;
Expand Down
Loading