mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
feat(nuxt): display banner when run with compatibilityVersion
(#27305)
This commit is contained in:
parent
73b820066e
commit
6a271e8a56
@ -13,7 +13,7 @@ import fse from 'fs-extra'
|
|||||||
import { withTrailingSlash, withoutLeadingSlash } from 'ufo'
|
import { withTrailingSlash, withoutLeadingSlash } from 'ufo'
|
||||||
|
|
||||||
import defu from 'defu'
|
import defu from 'defu'
|
||||||
import { gt } from 'semver'
|
import { gt, satisfies } from 'semver'
|
||||||
import pagesModule from '../pages/module'
|
import pagesModule from '../pages/module'
|
||||||
import metaModule from '../head/module'
|
import metaModule from '../head/module'
|
||||||
import componentsModule from '../components/module'
|
import componentsModule from '../components/module'
|
||||||
@ -559,6 +559,12 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client'))
|
addPlugin(resolve(nuxt.options.appDir, 'plugins/payload.client'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show compatibility version banner when Nuxt is running with a compatibility version
|
||||||
|
// that is different from the current major version
|
||||||
|
if (!(satisfies(nuxt._version, nuxt.options.future.compatibilityVersion + '.x'))) {
|
||||||
|
console.info(`Running with compatibility version \`${nuxt.options.future.compatibilityVersion}\``)
|
||||||
|
}
|
||||||
|
|
||||||
await nuxt.callHook('ready', nuxt)
|
await nuxt.callHook('ready', nuxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user