Skip to content

Commit 6287ccd

Browse files
committed
Resolve "Directory import '.../jsx-dom/min' is not supported resolving ES modules imported from ../jsx-dom/min/jsx-runtime.js" is vitest. This is caused by "export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs } from "jsx-dom/min";" as it should have /index.js at the end for ESM.
1 parent 81077d5 commit 6287ccd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

scripts/build.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,8 @@ export async function build({ targetDir, format, packageName }: BuildOptions) {
150150
buildRollup("jsx-runtime", {
151151
inject: { "./jsx-dom": packageName, delimiters: ["", ""] },
152152
}),
153-
buildRollup("jsx-runtime", {
154-
outputDir: OUT_DIR_MIN,
155-
inject: { "./jsx-dom": `${packageName}/min`, delimiters: ["", ""] },
156-
}),
157153
reexport("jsx-dev-runtime.js", OUT_DIR_MIN, "./jsx-runtime.js"),
154+
reexport("jsx-runtime.js", OUT_DIR_MIN, "./index.js", jsxRuntimeExports),
158155
reexport("index.d.ts", OUT_DIR_MIN, "../index"),
159156
reexport("jsx-runtime.d.ts", OUT_DIR_MIN, "./index", jsxRuntimeExports),
160157
reexport("jsx-runtime.d.ts", OUT_DIR, "./index", jsxRuntimeExports),

0 commit comments

Comments
 (0)