Skip to content

Commit 9a4a1f3

Browse files
committed
fix: only add server imports if the server config file is present
1 parent 20eadcb commit 9a4a1f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nuxt/src/module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export default defineNuxtModule<ModuleOptions>({
112112
});
113113

114114
// Preps the the middleware instrumentation module.
115-
addMiddlewareImports();
115+
if (serverConfigFile) {
116+
addMiddlewareImports();
117+
}
116118

117119
nuxt.hooks.hook('nitro:init', nitro => {
118120
if (serverConfigFile) {

0 commit comments

Comments
 (0)