valaxy 0.17.3 → 0.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/main.ts CHANGED
@@ -21,6 +21,8 @@ import 'uno.css'
21
21
 
22
22
  import setupMain from './setup/main'
23
23
 
24
+ const valaxyConfig = initValaxyConfig()
25
+
24
26
  /**
25
27
  * register global components
26
28
  * @param ctx
@@ -29,9 +31,13 @@ export function registerComponents(ctx: ViteSSGContext) {
29
31
  ctx.app.component('AppLink', AppLink)
30
32
  }
31
33
 
34
+ const { redirectRoutes, useVueRouter } = valaxyConfig.value.runtimeConfig.redirects
35
+ if (useVueRouter)
36
+ routes.push(...redirectRoutes)
37
+
32
38
  // fix chinese path
33
39
  routes.forEach((i) => {
34
- i.children?.forEach((j) => {
40
+ i?.children?.forEach((j) => {
35
41
  j.path = encodeURI(j.path)
36
42
  })
37
43
  })
@@ -66,10 +72,10 @@ export const createApp = ViteSSG(
66
72
  (ctx) => {
67
73
  // app-level provide
68
74
  const { app } = ctx
69
- const config = initValaxyConfig()
70
- app.provide(valaxyConfigSymbol, config)
75
+
76
+ app.provide(valaxyConfigSymbol, valaxyConfig)
71
77
 
72
78
  registerComponents(ctx)
73
- setupMain(ctx, config)
79
+ setupMain(ctx, valaxyConfig)
74
80
  },
75
81
  )