Merge branch 'dev' of github.com:nuxt/nuxt.js into dev

This commit is contained in:
Sebastien Chopin 2017-08-18 15:16:36 +02:00
commit c628097862
6 changed files with 25 additions and 23 deletions

View File

@ -32,7 +32,7 @@ if (argv.help) {
$ 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
`) `)
@ -74,8 +74,10 @@ builder.build()
.then(() => { .then(() => {
debug('Building done') debug('Building done')
if (options.mode === 'spa') { if (options.mode === 'spa') {
// Generate on spa mode // Disable minify to get exact results of nuxt start
return new Generator(nuxt, builder).generate({ build: false }).then(() => { nuxt.options.generate.minify = false
// Generate on SPA mode
return new Generator(nuxt, builder).generate({ build: false, minify: false }).then(() => {
if (!nuxt.options.dev) { if (!nuxt.options.dev) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(`✓ You can now directly upload ${nuxt.options.generate.dir}/ or start server using "nuxt start"`) console.log(`✓ You can now directly upload ${nuxt.options.generate.dir}/ or start server using "nuxt start"`)

View File

@ -42,7 +42,7 @@ if (argv.help) {
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
`) `)

View File

@ -30,7 +30,7 @@ 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
`) `)

View File

@ -35,7 +35,7 @@ if (argv.help) {
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
`) `)

View File

@ -158,7 +158,7 @@ Options.modes = {
ssr: true ssr: true
}, },
render: { render: {
ssr: 'static' ssr: 'only'
} }
} }
} }

View File

@ -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