mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxi): use new builder
option for vite/webpack info (#3658)
This commit is contained in:
parent
58a46f2270
commit
a7ce6d53b7
@ -42,9 +42,13 @@ export default defineNuxtCommand({
|
||||
// Check nuxt version
|
||||
const nuxtVersion = getDepVersion('nuxt') || getDepVersion('nuxt-edge') || getDepVersion('nuxt3') || '0.0.0'
|
||||
const isNuxt3 = nuxtVersion.startsWith('3')
|
||||
const useVite = isNuxt3
|
||||
? nuxtConfig.vite !== false
|
||||
: (nuxtConfig.buildModules?.find(m => m === 'nuxt-vite'))
|
||||
const builder = isNuxt3
|
||||
? nuxtConfig.builder /* latest schema */ || (nuxtConfig.vite !== false ? 'vite' : 'webpack') /* previous schema */
|
||||
: nuxtConfig.bridge?.vite
|
||||
? 'vite' /* bridge vite implementation */
|
||||
: (nuxtConfig.buildModules?.includes('nuxt-vite')
|
||||
? 'vite' /* nuxt-vite */
|
||||
: 'webpack')
|
||||
|
||||
let packageManager = getPackageManager(rootDir)
|
||||
if (packageManager) {
|
||||
@ -58,7 +62,7 @@ export default defineNuxtCommand({
|
||||
NodeVersion: process.version,
|
||||
NuxtVersion: nuxtVersion,
|
||||
PackageManager: packageManager,
|
||||
Bundler: useVite ? 'Vite' : 'Webpack',
|
||||
Builder: builder,
|
||||
UserConfig: Object.keys(nuxtConfig).map(key => '`' + key + '`').join(', '),
|
||||
RuntimeModules: listModules(nuxtConfig.modules),
|
||||
BuildModules: listModules(nuxtConfig.buildModules)
|
||||
|
Loading…
Reference in New Issue
Block a user