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 {
1919 pkgDir ?: string
2020 provider ?: string
2121 runtime ?: string
22+ mockPath ?: string
2223 }
2324 /**
2425 * Scan files from this root directory (ignoring node_modules).
@@ -29,6 +30,7 @@ export interface PluginOptions {
2930const SchemaOrgPkg = '@vueuse/schema-org'
3031
3132interface AliasPaths {
33+ mockPath ?: string
3234 pkgDir : string
3335 provider : string
3436 runtime : string
@@ -43,11 +45,12 @@ export const schemaOrgSwapAliases = () => createUnplugin<PluginOptions>((args) =
4345 const pkgDir = args . aliasPaths ?. pkgDir || dirname ( await resolvePath ( SchemaOrgPkg ) )
4446 let provider , runtime
4547 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
4750 }
4851 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` )
5154 }
5255 paths = {
5356 pkgDir,
You can’t perform that action at this time.
0 commit comments