Skip to content

Commit 817518b

Browse files
committedOct 2, 2024·
chore: update jiti and deps
1 parent 3fe6ad8 commit 817518b

File tree

5 files changed

+365
-397
lines changed

5 files changed

+365
-397
lines changed
 

‎build.config.ts

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ export default defineBuildConfig({
7070
"firebase-functions",
7171
"@scalar/api-reference",
7272
],
73-
stubOptions: {
74-
jiti: {
75-
// TOODO: remove when unbuild upgraded
76-
interopDefault: true,
77-
},
78-
},
7973
rollup: {
8074
output: {
8175
chunkFileNames(chunk: any) {

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"hookable": "^5.5.3",
135135
"httpxy": "^0.1.5",
136136
"ioredis": "^5.4.1",
137-
"jiti": "^2.0.0",
137+
"jiti": "^2.1.0",
138138
"klona": "^2.0.6",
139139
"knitwork": "^1.1.0",
140140
"listhen": "^1.8.0",
@@ -152,7 +152,7 @@
152152
"pkg-types": "^1.2.0",
153153
"pretty-bytes": "^6.1.1",
154154
"radix3": "^1.1.2",
155-
"rollup": "^4.22.5",
155+
"rollup": "^4.24.0",
156156
"rollup-plugin-visualizer": "^5.12.0",
157157
"scule": "^1.3.0",
158158
"semver": "^7.6.3",
@@ -184,7 +184,7 @@
184184
"@types/serve-static": "^1.15.7",
185185
"@types/xml2js": "^0.4.14",
186186
"@vitest/coverage-v8": "^2.1.1",
187-
"automd": "^0.3.8",
187+
"automd": "^0.3.9",
188188
"better-sqlite3": "^11.3.0",
189189
"changelogen": "^0.5.7",
190190
"edge-runtime": "^3.0.3",

‎pnpm-lock.yaml

+357-382
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/gen-presets.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
22
import { resolve } from "node:path";
33
import { fileURLToPath } from "node:url";
44
import { consola } from "consola";
5-
import createJITI from "jiti";
5+
import { createJiti } from "jiti";
66
import { findTypeExports } from "mlly";
77
import type { NitroPreset, NitroPresetMeta } from "nitropack/types";
88
import { camelCase, kebabCase, pascalCase, snakeCase } from "scule";
@@ -21,9 +21,7 @@ const presetDirs: string[] = readdirSync(presetsDir, { withFileTypes: true })
2121
.map((dir) => dir.name);
2222

2323
// --- Load presets ---
24-
const jitiRequire = createJITI(presetsDir, {
25-
esmResolve: true,
26-
interopDefault: true,
24+
const jiti = createJiti(presetsDir, {
2725
alias: {
2826
nitropack: fileURLToPath(new URL("../src/core/index.ts", import.meta.url)),
2927
...Object.fromEntries(
@@ -37,7 +35,9 @@ const jitiRequire = createJITI(presetsDir, {
3735
const allPresets: (NitroPreset & { _meta?: NitroPresetMeta })[] = [];
3836
for (const preset of presetDirs) {
3937
const presetPath = resolve(presetsDir, preset, "preset.ts");
40-
const _presets = jitiRequire(presetPath);
38+
const _presets = await jiti
39+
.import(presetPath)
40+
.then((mod) => (mod as any).default || mod);
4141
allPresets.push(..._presets);
4242
}
4343

‎src/core/module.ts

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ async function _resolveNitroModule(
3131
globalThis.defineNitroModule || ((mod) => mod);
3232

3333
const jiti = createJiti(nitroOptions.rootDir, {
34-
interopDefault: true,
3534
alias: nitroOptions.alias,
3635
});
3736
const _modPath = jiti.esmResolve(mod);

0 commit comments

Comments
 (0)
Please sign in to comment.