Skip to content

Commit f930cda

Browse files
committed
build: externalize cjs declarations
1 parent 80547bc commit f930cda

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineBuildConfig({
8080
);
8181

8282
config.external ??= [];
83-
(config.external as string[]).push(
83+
(config.external as (string | RegExp)[]).push(
8484
"nitro",
8585
...Object.keys(pkg.exports || {}).map((key) => key.replace(/^./, "nitro")),
8686
...Object.keys(pkg.dependencies),
@@ -97,7 +97,10 @@ export default defineBuildConfig({
9797
"@rspack/core",
9898
"@farmfe/core",
9999
"webpack",
100-
"unloader"
100+
"unloader",
101+
// CommonJS `.d.ts` modules that rolldown-plugin-dts cannot bundle
102+
"webpack-virtual-modules",
103+
/^zod(\/|$)/
101104
);
102105
},
103106
rolldownOutput(config) {

0 commit comments

Comments
 (0)