File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ function toArray<T>(arr: T | T[]): T[] {
11
11
return [ arr ]
12
12
}
13
13
14
+ /**
15
+ * This search for components in with the given options.
16
+ * Will be called multiple times to ensure file loaded,
17
+ * should normally run only once.
18
+ *
19
+ * TODO: watch on file changes for server mode
20
+ *
21
+ * @param ctx
22
+ * @param force
23
+ */
14
24
export async function searchComponents ( ctx : Context , force = false ) {
15
25
if ( force || ! ctx . _searchingPromise ) {
16
26
ctx . _searchingPromise = ( async ( ) => {
@@ -45,7 +55,6 @@ export async function searchComponents(ctx: Context, force = false) {
45
55
debug ( `[${ components . map ( i => i ) . join ( ', ' ) } ]` )
46
56
47
57
ctx . components = components
48
- ctx . _searchingPromise = undefined
49
58
} ) ( )
50
59
}
51
60
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { isResolverPath, generateResolver } from '../generator/resolver'
4
4
import { searchComponents } from '../glob'
5
5
6
6
export function createServerPlugin ( context : Context ) : ServerPlugin {
7
- return ( { app } ) => {
7
+ return ( { app, watcher } ) => {
8
+ // TODO: handle HMR use watch
9
+
8
10
app . use ( async ( ctx , next ) => {
9
11
if ( ! isResolverPath ( ctx . path ) )
10
12
return next ( )
You can’t perform that action at this time.
0 commit comments