File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface PluginOptions {
19
19
pkgDir ?: string
20
20
provider ?: string
21
21
runtime ?: string
22
+ mockPath ?: string
22
23
}
23
24
/**
24
25
* Scan files from this root directory (ignoring node_modules).
@@ -29,6 +30,7 @@ export interface PluginOptions {
29
30
const SchemaOrgPkg = '@vueuse/schema-org'
30
31
31
32
interface AliasPaths {
33
+ mockPath ?: string
32
34
pkgDir : string
33
35
provider : string
34
36
runtime : string
@@ -43,11 +45,12 @@ export const schemaOrgSwapAliases = () => createUnplugin<PluginOptions>((args) =
43
45
const pkgDir = args . aliasPaths ?. pkgDir || dirname ( await resolvePath ( SchemaOrgPkg ) )
44
46
let provider , runtime
45
47
if ( args ?. mock ) {
46
- provider = runtime = await resolvePath ( `${ SchemaOrgPkg } /runtime/mock` )
48
+ const mockPath = args . aliasPaths ?. mockPath || await resolvePath ( `${ pkgDir } /runtime-mock` )
49
+ provider = runtime = mockPath
47
50
}
48
51
else {
49
- provider = args . aliasPaths ?. provider || await resolvePath ( `${ SchemaOrgPkg } /${ args ?. full ? 'full' : 'simple' } ` )
50
- runtime = args . aliasPaths ?. runtime || await resolvePath ( `${ SchemaOrgPkg } /runtime` )
52
+ provider = args . aliasPaths ?. provider || await resolvePath ( `${ pkgDir } /providers /${ args ?. full ? 'full' : 'simple' } ` )
53
+ runtime = args . aliasPaths ?. runtime || await resolvePath ( `${ pkgDir } /runtime` )
51
54
}
52
55
paths = {
53
56
pkgDir,
You can’t perform that action at this time.
0 commit comments