mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
feat(nuxi): use nuxt/starter by default for templates
This commit is contained in:
parent
0af01668c1
commit
21b664cc74
@ -7,32 +7,21 @@ import { defineNuxtCommand } from './index'
|
|||||||
|
|
||||||
const rpath = p => relative(process.cwd(), p)
|
const rpath = p => relative(process.cwd(), p)
|
||||||
|
|
||||||
const knownTemplates = {
|
|
||||||
nuxt3: 'nuxt/starter#v3',
|
|
||||||
v3: 'nuxt/starter#v3',
|
|
||||||
bridge: 'nuxt/starter#bridge'
|
|
||||||
}
|
|
||||||
|
|
||||||
const resolveTemplate = (template) => {
|
const resolveTemplate = (template) => {
|
||||||
if (!template) {
|
|
||||||
return knownTemplates.nuxt3
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof template === 'boolean') {
|
if (typeof template === 'boolean') {
|
||||||
consola.error('Please specify a template')
|
consola.error('Please specify a template!')
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (template in knownTemplates) {
|
if (!template) {
|
||||||
return knownTemplates[template]
|
template = 'v3'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (template.includes('/')) {
|
if (template.includes('/')) {
|
||||||
return template
|
return template
|
||||||
}
|
}
|
||||||
|
|
||||||
consola.error(`Invalid template name: \`${template}\``)
|
return `nuxt/starter#${template}`
|
||||||
process.exit(1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineNuxtCommand({
|
export default defineNuxtCommand({
|
||||||
|
Loading…
Reference in New Issue
Block a user