mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix: fix issues with router.base support
This commit is contained in:
parent
dc6154fea8
commit
4f74119739
@ -76,6 +76,7 @@ export const getRollupConfig = (config: SLSOptions) => {
|
||||
values: {
|
||||
'process.env.NODE_ENV': '"production"',
|
||||
'typeof window': '"undefined"',
|
||||
'process.env.ROUTER_BASE': JSON.stringify(config.routerBase),
|
||||
'process.env.NUXT_STATIC_BASE': JSON.stringify(config.staticAssets.base),
|
||||
'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version),
|
||||
// @ts-ignore
|
||||
|
@ -28,14 +28,13 @@ if ('serviceWorker' in navigator) {
|
||||
'template:document' (tmpl) {
|
||||
tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>')
|
||||
},
|
||||
async done ({ targetDir, publicDir }) {
|
||||
const rootIndex = resolve(publicDir, 'index.html')
|
||||
const rootFallback = resolve(publicDir, '200.html')
|
||||
if (!existsSync(rootIndex) && existsSync(rootFallback)) {
|
||||
await copy(rootFallback, rootIndex)
|
||||
async done ({ rootDir, publicDir }) {
|
||||
const fallback200 = resolve(publicDir, '200.html')
|
||||
const fallback400 = resolve(publicDir, '400.html')
|
||||
if (!existsSync(fallback400) && existsSync(fallback200)) {
|
||||
await copy(fallback200, fallback400)
|
||||
}
|
||||
|
||||
consola.info(`Try with \`npx serve ${relative(process.cwd(), targetDir)}\``)
|
||||
consola.info(`Try with \`nuxt start ${relative(process.cwd(), rootDir)}\``)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user