feat: vite-ssg (#24)
This commit is contained in:
1 parent
d090ba51b4
commit
9978e5e5a1
9 files changed
+258
-1287
No files matched your search
+16
-7
@@ -1,12 +1,21 @@
|
||||
import './main.postcss'
|
||||
import { createApp } from 'vue'
|
||||
// import routes generated by Voie
|
||||
import routes from 'voie-pages'
|
||||
// progress bar
|
||||
import NProgress from 'nprogress'
|
||||
import { ViteSSG } from 'vite-ssg'
|
||||
import installPlugins from './plugins'
|
||||
|
||||
import App from './App.vue'
|
||||
|
||||
const app = createApp(App)
|
||||
export const createApp = ViteSSG(
|
||||
App,
|
||||
{ routes },
|
||||
({ app, router, isClient }) => {
|
||||
installPlugins(app)
|
||||
|
||||
installPlugins(app)
|
||||
|
||||
// true for hydrate
|
||||
app.mount('#app', true)
|
||||
if (isClient) {
|
||||
router.beforeEach(() => { NProgress.start() })
|
||||
router.afterEach(() => { NProgress.done() })
|
||||
}
|
||||
}
|
||||
)
|
||||
Reference in new issue
Block a user