mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
fix generate only index.html when router.mode = 'hash'
This commit is contained in:
parent
2ff304898d
commit
b060090fb1
@ -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) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user