From b9a1be72256c5583d2b4ba303ebe508e246198ce Mon Sep 17 00:00:00 2001 From: harlan Date: Fri, 6 Sep 2024 00:04:17 +1000 Subject: [PATCH] refactor: cleaner robots module check --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index bf3ed266..f3dd6763 100644 --- a/src/module.ts +++ b/src/module.ts @@ -244,7 +244,7 @@ export default defineNuxtModule({ } let needsRobotsPolyfill = true - const robotsModuleName = hasNuxtModule('nuxt-simple-robots') ? 'nuxt-simple-robots' : hasNuxtModule('@nuxtjs/robots') ? '@nuxtjs/robots' : false + const robotsModuleName = ['nuxt-simple-robots', '@nuxtjs/robots'].find(s => hasNuxtModule(s)) if (robotsModuleName) { const robotsVersion = await getNuxtModuleVersion(robotsModuleName) // we want to keep versions in sync