Skip to content

Commit f356488

Browse files
committed
feat: log shell URL during startup
1 parent f11a8e7 commit f356488

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
addImportsDir,
1111
extendPages,
1212
resolveModule,
13+
useLogger,
1314
} from '@nuxt/kit'
1415
import type { NuxtPage, NuxtModule } from '@nuxt/schema'
1516
import { joinURL, withoutLeadingSlash, withoutTrailingSlash } from 'ufo'
@@ -296,6 +297,15 @@ const _module: NuxtModule<NuxtStoriesOptions> = defineNuxtModule<NuxtStoriesOpti
296297
})
297298
}
298299

300+
if (nuxt.options.dev && mode !== 'frame') {
301+
const logger = useLogger('nuxt-stories')
302+
nuxt.hook('listen', (_server, listener) => {
303+
const base = (listener.url as string).replace(/\/$/, '')
304+
const storiesUrl = base + (routeBasePath === '/' ? '' : routeBasePath)
305+
logger.box(`nuxt-stories\n\n ➜ ${storiesUrl}`)
306+
})
307+
}
308+
299309
// Child route arrays — shared by both shell and frame parents
300310
const shellChildren: NuxtPage[] = []
301311
const frameChildren: NuxtPage[] = []

0 commit comments

Comments
 (0)