Skip to content

Commit 9c74974

Browse files
authored
feat: update jiti from v1 to v2
1 parent 5a781e5 commit 9c74974

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

package-lock.json

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"cosmiconfig": "^9.0.0",
49-
"jiti": "^1.21.6",
49+
"jiti": "^2.5.1",
5050
"semver": "^7.6.2"
5151
},
5252
"devDependencies": {

src/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ async function loadConfig(loaderContext, config, postcssOptions) {
143143
if (!tsLoader) {
144144
const opts = { interopDefault: true };
145145

146-
const jiti = require("jiti")(__filename, opts);
146+
const { createJiti } = require("jiti");
147147

148-
tsLoader = (filepath) => jiti(filepath);
148+
const jiti = createJiti(__filename, opts);
149+
150+
tsLoader = (filepath) => jiti.import(filepath, { default: true });
149151
}
150152

151153
loaders[".cts"] = tsLoader;

0 commit comments

Comments
 (0)