mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Merge pull request #1937 from pimlie/issue-no-index
(generate) dont assume /index.html exists when copying to 200.html
This commit is contained in:
commit
d787ab4e0a
@ -73,11 +73,14 @@ export default class Generator extends Tapable {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy /index.html to /200.html for surge SPA
|
const indexPath = join(this.distPath, 'index.html')
|
||||||
// https://surge.sh/help/adding-a-200-page-for-client-side-routing
|
if (existsSync(indexPath) {
|
||||||
const _200Path = join(this.distPath, '200.html')
|
// Copy /index.html to /200.html for surge SPA
|
||||||
if (!existsSync(_200Path)) {
|
// https://surge.sh/help/adding-a-200-page-for-client-side-routing
|
||||||
await copy(join(this.distPath, 'index.html'), _200Path)
|
const _200Path = join(this.distPath, '200.html')
|
||||||
|
if (!existsSync(_200Path)) {
|
||||||
|
await copy(indexPath, _200Path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const duration = Math.round((Date.now() - s) / 100) / 10
|
const duration = Math.round((Date.now() - s) / 100) / 10
|
||||||
|
Loading…
Reference in New Issue
Block a user