Skip to content

Commit 0112801

Browse files
committedJun 5, 2024·
build: hotfix unbuild to resolve jiti stub await issue
1 parent 4106750 commit 0112801

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed
 

‎package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@
7070
"nitro": "./dist/cli/index.mjs",
7171
"nitropack": "./dist/cli/index.mjs"
7272
},
73-
"files": ["dist", "*.d.ts", "runtime-meta.*"],
73+
"files": [
74+
"dist",
75+
"*.d.ts",
76+
"runtime-meta.*"
77+
],
7478
"scripts": {
7579
"build": "pnpm gen-presets && unbuild",
7680
"dev": "pnpm nitro dev playground",
@@ -220,6 +224,9 @@
220224
"react-dom",
221225
"@algolia/client-search"
222226
]
227+
},
228+
"patchedDependencies": {
229+
"unbuild@3.0.0-rc.2": "patches/unbuild@3.0.0-rc.2.patch"
223230
}
224231
}
225232
}

‎patches/unbuild@3.0.0-rc.2.patch

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/dist/shared/unbuild.Cs2j_FHl.mjs b/dist/shared/unbuild.Cs2j_FHl.mjs
2+
index 6da397241a3f2ca90d72d2dd98985690061cf172..2a5b8c3f22826e974d4c9af05b58a631ada2efa7 100644
3+
--- a/dist/shared/unbuild.Cs2j_FHl.mjs
4+
+++ b/dist/shared/unbuild.Cs2j_FHl.mjs
5+
@@ -647,7 +647,7 @@ async function rollupBuild(ctx) {
6+
`const _jiti = jiti(null, ${serializedJitiOptions})`,
7+
"",
8+
`/** @type {import(${JSON.stringify(resolvedEntryForTypeImport)})} */`,
9+
- `const _module = await _jiti.import(${JSON.stringify(
10+
+ `const _module = _jiti(${JSON.stringify(
11+
resolvedEntry
12+
)});`,
13+
hasDefaultExport ? "\nexport default _module;" : "",

‎pnpm-lock.yaml

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

0 commit comments

Comments
 (0)