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>({
110110 config . plugins . push ( SchemaOrgVitePlugin ( {
111111 mock : ! moduleOptions . client && isClient ,
112112 full : moduleOptions . full ,
113- runtimePath : nuxtSchemaComposablesRuntime ,
113+ aliasPaths : {
114+ pkgDir : schemaOrgPath ,
115+ runtime : nuxtSchemaComposablesRuntime ,
116+ } ,
114117 } ) )
115118 } )
116119 } ,
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ export interface PluginOptions {
1515 /**
1616 * Path to a real custom runtime (not mocked).
1717 */
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+ }
2323 /**
2424 * Scan files from this root directory (ignoring node_modules).
2525 */
@@ -40,14 +40,14 @@ export const schemaOrgSwapAliases = () => createUnplugin<PluginOptions>((args) =
4040 const fetchPaths = async ( ) => {
4141 if ( paths )
4242 return paths
43- const pkgDir = dirname ( await resolvePath ( SchemaOrgPkg ) )
43+ const pkgDir = args . aliasPaths ?. pkgDir || dirname ( await resolvePath ( SchemaOrgPkg ) )
4444 let provider , runtime
4545 if ( args ?. mock ) {
4646 provider = runtime = await resolvePath ( `${ SchemaOrgPkg } /runtime/mock` )
4747 }
4848 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` )
5151 }
5252 paths = {
5353 pkgDir,
You can’t perform that action at this time.
0 commit comments