Skip to content

Commit

Permalink
fix: merge route record
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Oct 5, 2022
1 parent d606c0d commit f1e7c8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export function createRoutesContext(options: ResolvedOptions) {

function generateRoutes() {
// keys are import names while values are paths import __ from __
// TODO: reverse the order and make a list of named imports and another for defaults?
const importList = new Map<string, string>()

const routesExport = `export const routes = ${generateRouteRecord(
Expand All @@ -154,7 +155,8 @@ export function createRoutesContext(options: ResolvedOptions) {
)}`

let imports = ''
if (options.dataFetching) {
// FIXME: after demo
if (true || options.dataFetching) {
imports += `import { _HasDataLoaderMeta, _mergeRouteRecord } from 'unplugin-vue-router/runtime'\n`
}
for (const [name, path] of importList) {
Expand Down

0 comments on commit f1e7c8b

Please sign in to comment.