mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
static ~> ssr-only
This commit is contained in:
parent
fbb6833400
commit
d589bc5819
@ -31,10 +31,10 @@ if (argv.help) {
|
|||||||
Usage
|
Usage
|
||||||
$ nuxt build <dir>
|
$ nuxt build <dir>
|
||||||
Options
|
Options
|
||||||
--analyze, -a Launch webpack-bundle-analyzer to optimize your bundles.
|
--analyze, -a Launch webpack-bundle-analyzer to optimize your bundles.
|
||||||
--mode, -m [spa|universal|static] Nuxt Mode (default: universal)
|
--mode, -m [spa|universal|ssr-only] Nuxt Mode (default: universal)
|
||||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||||
--help, -h Displays this message
|
--help, -h Displays this message
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
10
bin/nuxt-dev
10
bin/nuxt-dev
@ -40,11 +40,11 @@ if (argv.help) {
|
|||||||
Usage
|
Usage
|
||||||
$ nuxt dev <dir> -p <port number> -H <hostname>
|
$ nuxt dev <dir> -p <port number> -H <hostname>
|
||||||
Options
|
Options
|
||||||
--port, -p A port number on which to start the application
|
--port, -p A port number on which to start the application
|
||||||
--hostname, -H Hostname on which to start the application
|
--hostname, -H Hostname on which to start the application
|
||||||
--mode, -m [spa|universal|static] Nuxt Mode (default: universal)
|
--mode, -m [spa|universal|ssr-only] Nuxt Mode (default: universal)
|
||||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||||
--help, -h Displays this message
|
--help, -h Displays this message
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@ if (argv.help) {
|
|||||||
Usage
|
Usage
|
||||||
$ nuxt generate <dir>
|
$ nuxt generate <dir>
|
||||||
Options
|
Options
|
||||||
--mode, -m [spa|universal|static] Nuxt Mode (default: universal)
|
--mode, -m [spa|universal|ssr-only] Nuxt Mode (default: universal)
|
||||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||||
--help, -h Displays this message
|
--help, -h Displays this message
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,11 @@ if (argv.help) {
|
|||||||
Usage
|
Usage
|
||||||
$ nuxt start <dir> -p <port number> -H <hostname>
|
$ nuxt start <dir> -p <port number> -H <hostname>
|
||||||
Options
|
Options
|
||||||
--port, -p A port number on which to start the application
|
--port, -p A port number on which to start the application
|
||||||
--hostname, -H Hostname on which to start the application
|
--hostname, -H Hostname on which to start the application
|
||||||
--mode, -m [spa|universal|static] Nuxt Mode (default: universal)
|
--mode, -m [spa|universal|ssr-only] Nuxt Mode (default: universal)
|
||||||
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
--config-file, -c Path to Nuxt.js config file (default: nuxt.config.js)
|
||||||
--help, -h Displays this message
|
--help, -h Displays this message
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ Options.modes = {
|
|||||||
ssr: true
|
ssr: true
|
||||||
},
|
},
|
||||||
render: {
|
render: {
|
||||||
ssr: 'static'
|
ssr: 'only'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,8 +116,8 @@ export default class Renderer extends Tapable {
|
|||||||
return this.options.render.ssr === false
|
return this.options.render.ssr === false
|
||||||
}
|
}
|
||||||
|
|
||||||
get staticSSR () {
|
get onlySSR () {
|
||||||
return this.options.render.ssr === 'static'
|
return this.options.render.ssr === 'only'
|
||||||
}
|
}
|
||||||
|
|
||||||
get isReady () {
|
get isReady () {
|
||||||
@ -455,7 +455,7 @@ export default class Renderer extends Tapable {
|
|||||||
|
|
||||||
let resourceHints = ''
|
let resourceHints = ''
|
||||||
|
|
||||||
if (!this.staticSSR) {
|
if (!this.onlySSR) {
|
||||||
if (this.options.render.resourceHints) {
|
if (this.options.render.resourceHints) {
|
||||||
resourceHints = context.renderResourceHints()
|
resourceHints = context.renderResourceHints()
|
||||||
HEAD += resourceHints
|
HEAD += resourceHints
|
||||||
|
Loading…
Reference in New Issue
Block a user