mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +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: {
|
values: {
|
||||||
'process.env.NODE_ENV': '"production"',
|
'process.env.NODE_ENV': '"production"',
|
||||||
'typeof window': '"undefined"',
|
'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_BASE': JSON.stringify(config.staticAssets.base),
|
||||||
'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version),
|
'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version),
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -28,14 +28,13 @@ if ('serviceWorker' in navigator) {
|
|||||||
'template:document' (tmpl) {
|
'template:document' (tmpl) {
|
||||||
tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>')
|
tmpl.compiled = tmpl.compiled.replace('</body>', script + '</body>')
|
||||||
},
|
},
|
||||||
async done ({ targetDir, publicDir }) {
|
async done ({ rootDir, publicDir }) {
|
||||||
const rootIndex = resolve(publicDir, 'index.html')
|
const fallback200 = resolve(publicDir, '200.html')
|
||||||
const rootFallback = resolve(publicDir, '200.html')
|
const fallback400 = resolve(publicDir, '400.html')
|
||||||
if (!existsSync(rootIndex) && existsSync(rootFallback)) {
|
if (!existsSync(fallback400) && existsSync(fallback200)) {
|
||||||
await copy(rootFallback, rootIndex)
|
await copy(fallback200, fallback400)
|
||||||
}
|
}
|
||||||
|
consola.info(`Try with \`nuxt start ${relative(process.cwd(), rootDir)}\``)
|
||||||
consola.info(`Try with \`npx serve ${relative(process.cwd(), targetDir)}\``)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user