fix generate only index.html when router.mode = 'hash'

This commit is contained in:
Alexandre Chopin 2017-05-17 16:20:14 +02:00
parent 2ff304898d
commit b060090fb1

View File

@ -69,7 +69,7 @@ export default async function () {
} }
await copy(srcBuiltPath, distNuxtPath) await copy(srcBuiltPath, distNuxtPath)
debug('Static & build files copied') debug('Static & build files copied')
if (this.options.router !== 'hash') { if (this.options.router.mode !== 'hash') {
// Resolve config.generate.routes promises before generating the routes // Resolve config.generate.routes promises before generating the routes
try { try {
var generateRoutes = await promisifyRoute(this.options.generate.routes || []) var generateRoutes = await promisifyRoute(this.options.generate.routes || [])
@ -91,7 +91,7 @@ export default async function () {
/* /*
** Generate only index.html for router.mode = 'hash' ** Generate only index.html for router.mode = 'hash'
*/ */
let routes = (this.options.router === 'hash') ? ['/'] : this.routes let routes = (this.options.router.mode === 'hash') ? ['/'] : this.routes
while (routes.length) { while (routes.length) {
let n = 0 let n = 0
await Promise.all(routes.splice(0, 500).map(async (route) => { await Promise.all(routes.splice(0, 500).map(async (route) => {