Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/nuxt-cli/bin/nuxi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ if (process.argv[2] === 'dev') {
await import('../dist/boot.mjs').then(({ bootDevUI }) => bootDevUI()).catch(() => {})
}

// eslint-disable-next-line antfu/no-top-level-await
const { runMain } = await import('../dist/index.mjs')
// Mirrors citty's built-in version flag without loading the command graph.
const args = process.argv.slice(2)
if (args.length === 1 && (args[0] === '--version' || args[0] === '-v')) {
// eslint-disable-next-line no-console
console.log(nodeModule.createRequire(import.meta.url)('../package.json').version)
}
else {
// eslint-disable-next-line antfu/no-top-level-await
const { runMain } = await import('../dist/index.mjs')

runMain()
runMain()
}
Loading