Skip to content

Commit 3ca9849

Browse files
committed
Make TS happy about the new onwarn handler
1 parent 42b57c9 commit 3ca9849

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,13 @@ export const nodePolyfills = (options: PolyfillOptions = {}): Plugin => {
199199
build: {
200200
rollupOptions: {
201201
onwarn: (warning, rollupWarn) => {
202-
handleCircularDependancyWarning(warning, config.build?.rollupOptions?.onwarn ?? rollupWarn)
202+
handleCircularDependancyWarning(warning, () => {
203+
if (config.build?.rollupOptions?.onwarn) {
204+
return config.build.rollupOptions.onwarn(warning, rollupWarn)
205+
}
206+
207+
rollupWarn(warning)
208+
})
203209
},
204210
plugins: [
205211
{

0 commit comments

Comments
 (0)