mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix: add better logs for DX with target option (#8206)
* fix: add better logs for DX with target option * chore: add warning for old nuxt build in ssr false * Update generator.js * Update generate.js * chore: better logs * fix: update
This commit is contained in:
parent
044d07cb17
commit
7e7190b90d
@ -24,8 +24,7 @@ import {
|
||||
stripWhitespace,
|
||||
isIndexFileAndFolder,
|
||||
scanRequireTree,
|
||||
TARGETS,
|
||||
isFullStatic
|
||||
TARGETS
|
||||
} from '@nuxt/utils'
|
||||
|
||||
import Ignore from './ignore'
|
||||
@ -130,8 +129,7 @@ export default class Builder {
|
||||
} else {
|
||||
consola.info(`Bundling only for ${chalk.bold.green('client')} side`)
|
||||
}
|
||||
const target = isFullStatic(this.options) ? 'full static' : this.options.target
|
||||
consola.info(`Target: ${chalk.bold.cyan(target)}`)
|
||||
consola.info(`Target: ${chalk.bold.cyan(this.options.target)}`)
|
||||
}
|
||||
|
||||
// Wait for nuxt ready
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { TARGETS } from '@nuxt/utils'
|
||||
import consola from 'consola'
|
||||
import { common, locking } from '../options'
|
||||
import { normalizeArg, createLock } from '../utils'
|
||||
import { ensureBuild, generate } from '../utils/generate'
|
||||
@ -75,6 +76,7 @@ export default {
|
||||
|
||||
// Forcing static target anyway
|
||||
config.target = TARGETS.static
|
||||
consola.warn(`For using \`nuxt generate\`, your have to set \`target: 'static'\` in your \`nuxt.config\`\n 👉 Learn more about it on https://go.nuxtjs.dev/static-target`)
|
||||
|
||||
// Set flag to keep the prerendering behaviour
|
||||
config._legacyGenerate = true
|
||||
|
@ -16,6 +16,9 @@ export default class Generator {
|
||||
|
||||
// Set variables
|
||||
this.isFullStatic = isFullStatic(this.options)
|
||||
if (this.isFullStatic) {
|
||||
consola.info(`Full static generation activated`)
|
||||
}
|
||||
this.staticRoutes = path.resolve(this.options.srcDir, this.options.dir.static)
|
||||
this.srcBuiltPath = path.resolve(this.options.buildDir, 'dist', 'client')
|
||||
this.distPath = this.options.generate.dir
|
||||
|
Loading…
Reference in New Issue
Block a user