File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 22
33import Git from 'simple-git'
44import * as process from 'node:process'
5+ import { useNuxt } from 'nuxt/kit'
56
67export { version } from '../package.json'
78
@@ -149,13 +150,16 @@ export async function getEnv(isDevelopment: boolean) {
149150 : branch === 'main'
150151 ? 'canary'
151152 : 'release'
153+ const nuxt = useNuxt ( )
154+ const devUrl = isDevelopment ? `http://127.0.0.1:${ nuxt . options . devServer . port } ` : undefined
152155 const previewUrl = getPreviewUrl ( )
153156 const productionUrl = getProductionUrl ( )
154157 return {
155158 commit,
156159 shortCommit,
157160 branch,
158161 env,
162+ devUrl,
159163 previewUrl,
160164 productionUrl,
161165 prNumber,
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ export default defineNuxtModule({
1212 async setup ( ) {
1313 const nuxt = useNuxt ( )
1414
15- const { previewUrl, productionUrl } = await getEnv ( nuxt . options . dev )
16- const clientUri = productionUrl || previewUrl || 'http://127.0.0.1:3000'
15+ const { devUrl , previewUrl, productionUrl } = await getEnv ( nuxt . options . dev )
16+ const clientUri = productionUrl || previewUrl || devUrl || 'http://127.0.0.1:3000'
1717
1818 // bake it into a virtual file
1919 addServerTemplate ( {
You can’t perform that action at this time.
0 commit comments