File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,10 @@ export default defineNuxtModule<ModuleOptions>({
110
110
config . plugins . push ( SchemaOrgVitePlugin ( {
111
111
mock : ! moduleOptions . client && isClient ,
112
112
full : moduleOptions . full ,
113
- runtimePath : nuxtSchemaComposablesRuntime ,
113
+ aliasPaths : {
114
+ pkgDir : schemaOrgPath ,
115
+ runtime : nuxtSchemaComposablesRuntime ,
116
+ } ,
114
117
} ) )
115
118
} )
116
119
} ,
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ export interface PluginOptions {
15
15
/**
16
16
* Path to a real custom runtime (not mocked).
17
17
*/
18
- runtimePath ?: string
19
- /**
20
- * Path to a real custom provider (not mocked).
21
- */
22
- providerPath ?: string
18
+ aliasPaths ?: {
19
+ pkgDir ?: string
20
+ provider ?: string
21
+ runtime ?: string
22
+ }
23
23
/**
24
24
* Scan files from this root directory (ignoring node_modules).
25
25
*/
@@ -40,14 +40,14 @@ export const schemaOrgSwapAliases = () => createUnplugin<PluginOptions>((args) =
40
40
const fetchPaths = async ( ) => {
41
41
if ( paths )
42
42
return paths
43
- const pkgDir = dirname ( await resolvePath ( SchemaOrgPkg ) )
43
+ const pkgDir = args . aliasPaths ?. pkgDir || dirname ( await resolvePath ( SchemaOrgPkg ) )
44
44
let provider , runtime
45
45
if ( args ?. mock ) {
46
46
provider = runtime = await resolvePath ( `${ SchemaOrgPkg } /runtime/mock` )
47
47
}
48
48
else {
49
- provider = args ?. providerPath || await resolvePath ( `${ SchemaOrgPkg } /${ args ?. full ? 'full' : 'simple' } ` )
50
- runtime = args ?. runtimePath || await resolvePath ( `${ SchemaOrgPkg } /runtime` )
49
+ provider = args . aliasPaths ?. provider || await resolvePath ( `${ SchemaOrgPkg } /${ args ?. full ? 'full' : 'simple' } ` )
50
+ runtime = args . aliasPaths ?. runtime || await resolvePath ( `${ SchemaOrgPkg } /runtime` )
51
51
}
52
52
paths = {
53
53
pkgDir,
You can’t perform that action at this time.
0 commit comments