mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(kit): properly read nuxt version (resolves #616)
This commit is contained in:
parent
6e496373f3
commit
bba79f4836
@ -259,7 +259,9 @@ export function addVitePlugin (plugin: VitePlugin, options?: ExtendViteConfigOpt
|
||||
* Check if current nuxt instance is version 2 legacy
|
||||
*/
|
||||
export function isNuxt2 (nuxt?: any) {
|
||||
return (nuxt || useNuxt()).version?.startsWith('v2')
|
||||
nuxt = nuxt || useNuxt()
|
||||
const version = (nuxt?.version || nuxt?.constructor?.version || '').replace(/^v|-.*$/g, '')
|
||||
return version.startsWith('2.')
|
||||
}
|
||||
|
||||
export async function compileTemplate (template: NuxtTemplate, ctx: any) {
|
||||
|
Loading…
Reference in New Issue
Block a user