From d8d1ea7de2a4cfd2f7d72c3b19a679730fe885c0 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 5 Jul 2022 16:51:47 +0200 Subject: [PATCH] feat: expose the context --- src/core/tree.ts | 2 +- src/core/treeLeafValue.ts | 4 ++-- src/index.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/tree.ts b/src/core/tree.ts index 31a3a93f3..bb28f4fa6 100644 --- a/src/core/tree.ts +++ b/src/core/tree.ts @@ -31,7 +31,7 @@ export class TreeLeaf { } /** - * Adds a path to the tree + * Adds a path to the tree. `path` cannot start with a `/`. * * @param path - route path of the file * @param filePath - file path, defaults to path for convenience and testing diff --git a/src/core/treeLeafValue.ts b/src/core/treeLeafValue.ts index fafe2dabf..3d96f3cae 100644 --- a/src/core/treeLeafValue.ts +++ b/src/core/treeLeafValue.ts @@ -1,5 +1,5 @@ -import { RouteMeta, RouteRecordName } from 'vue-router' -import { joinPath, trimExtension } from './utils' +import { RouteMeta } from 'vue-router' +import { joinPath } from './utils' export const enum TreeLeafType { static, diff --git a/src/index.ts b/src/index.ts index 67b1ba6b5..e4d8aceed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,7 @@ export default createUnplugin((opt, meta) => { } }) +export { createRoutesContext } export { getFileBasedRouteName, getPascalCaseRouteName } from './core/utils' export type {