Skip to content

Commit 74134d2

Browse files
committed
perf(app): tree-shake extra condition
1 parent af7f156 commit 74134d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/internal/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function createH3App(config: H3Config) {
160160
...findRoutedMiddleware(method!, pathname!).map((r) => r.data)
161161
);
162162
}
163-
if (route?.data?.middleware?.length) {
163+
if (hasRoutes && route?.data?.middleware?.length) {
164164
middleware.push(...route.data.middleware);
165165
}
166166
return middleware;

0 commit comments

Comments
 (0)