优化PrerenderSPAPlugin配置
This commit is contained in:
parent
eff248a404
commit
58c3669287
@ -16,5 +16,9 @@ Vue.config.productionTip = false
|
|||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
render: (h) => h(App)
|
render: (h) => h(App),
|
||||||
|
mounted() {
|
||||||
|
// You'll need this for renderAfterDocumentEvent.
|
||||||
|
document.dispatchEvent(new Event('render-event'))
|
||||||
|
}
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
@ -30,12 +30,8 @@ const routes: Array<RouteConfig> = [
|
|||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Main',
|
name: 'Main',
|
||||||
component: mobile ? MobileIndex : Index
|
component: mobile ? MobileIndex : Index,
|
||||||
},
|
alias: '/index.html'
|
||||||
{
|
|
||||||
path: '/index.html',
|
|
||||||
name: 'Main1',
|
|
||||||
component: mobile ? MobileIndex : Index
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/market',
|
path: '/market',
|
||||||
@ -68,27 +64,32 @@ const routes: Array<RouteConfig> = [
|
|||||||
{
|
{
|
||||||
path: '/nft',
|
path: '/nft',
|
||||||
name: 'Nft',
|
name: 'Nft',
|
||||||
component: mobile ? MobileNft : NFT
|
component: mobile ? MobileNft : NFT,
|
||||||
|
alias: '/nft/index.html'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/gameplay',
|
path: '/gameplay',
|
||||||
name: 'Gameplay',
|
name: 'Gameplay',
|
||||||
component: mobile ? MobileGameplay : Gameplay
|
component: mobile ? MobileGameplay : Gameplay,
|
||||||
|
alias: '/gameplay/index.html'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/tokenomic',
|
path: '/tokenomic',
|
||||||
name: 'Tokenomic',
|
name: 'Tokenomic',
|
||||||
component: mobile ? MobileTokennomic : Tokenomic
|
component: mobile ? MobileTokennomic : Tokenomic,
|
||||||
|
alias: '/tokenomic/index.html'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/team',
|
path: '/team',
|
||||||
name: 'Team',
|
name: 'Team',
|
||||||
component: mobile ? MobileTeam : Team
|
component: mobile ? MobileTeam : Team,
|
||||||
|
alias: '/team/index.html'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/roadmap',
|
path: '/roadmap',
|
||||||
name: 'Roadmap',
|
name: 'Roadmap',
|
||||||
component: mobile ? MobileRoadmap : Roadmap
|
component: mobile ? MobileRoadmap : Roadmap,
|
||||||
|
alias: '/roadmap/index.html'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container" :style="cstyle">
|
<div class="container">
|
||||||
<mobile-header current-section="roadmap"></mobile-header>
|
<mobile-header current-section="roadmap"></mobile-header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="title-bar">
|
<div class="title-bar">
|
||||||
|
@ -32,16 +32,16 @@ module.exports = {
|
|||||||
args[0].title = 'CEBG: CRYPTO ELITE‘S BATTLEGROUNDS'
|
args[0].title = 'CEBG: CRYPTO ELITE‘S BATTLEGROUNDS'
|
||||||
return args
|
return args
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
configureWebpack(config) {
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
config.plugins.push(
|
||||||
|
new PrerenderSPAPlugin({
|
||||||
|
indexPath: path.resolve('dist/index.html'),
|
||||||
|
staticDir: path.resolve('dist'),
|
||||||
|
routes: ['/nft', '/gameplay', '/tokenomic', '/roadmap', '/team']
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// configureWebpack(config) {
|
|
||||||
// if (process.env.NODE_ENV === 'production') {
|
|
||||||
// config.plugins.push(
|
|
||||||
// new PrerenderSPAPlugin({
|
|
||||||
// indexPath: path.resolve('dist/index.html'),
|
|
||||||
// staticDir: path.resolve('dist'),
|
|
||||||
// routes: ['/nft', '/gameplay', '/tokenomic']
|
|
||||||
// })
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user