2022-01-17 17:06:10 +00:00
|
|
|
/**
|
|
|
|
* @author Martin Karkowski
|
|
|
|
* @email m.karkowski@zema.de
|
|
|
|
* @desc [description]
|
|
|
|
*/
|
|
|
|
|
2022-04-08 06:10:39 +00:00
|
|
|
import { INopePackageLoaderConstructor } from "../index.browser";
|
|
|
|
import {
|
|
|
|
IDispatcherConstructor,
|
|
|
|
INopeDispatcherOptions,
|
|
|
|
} from "../types/nope/nopeDispatcher.interface";
|
2022-01-17 17:06:10 +00:00
|
|
|
import { getPackageLoader as getBrowserPackageLoader } from "./getPackageLoader.browser";
|
|
|
|
import { NopePackageLoaderFileAccess } from "./nopePackageLoader.nodejs";
|
|
|
|
|
|
|
|
/**
|
2022-04-08 06:10:39 +00:00
|
|
|
* Function to extract the Package-Loader. This one here includes file access.
|
|
|
|
* @param {INopeDispatcherOptions} dispatcherOptions The provided options for the Dispatcher
|
|
|
|
* @param options Settings for the creation of the Dispatcher etc.
|
|
|
|
* @returns {INopePackageLoader} The Package loader.
|
2022-01-17 17:06:10 +00:00
|
|
|
*/
|
|
|
|
export function getPackageLoader(
|
2022-04-08 06:10:39 +00:00
|
|
|
dispatcherOptions: INopeDispatcherOptions,
|
|
|
|
options: {
|
|
|
|
packageLoaderConstructorClass?: INopePackageLoaderConstructor;
|
|
|
|
dispatcherConstructorClass?: IDispatcherConstructor;
|
|
|
|
singleton?: boolean;
|
|
|
|
useBaseServices?: boolean;
|
|
|
|
} = {}
|
2022-01-17 17:06:10 +00:00
|
|
|
) {
|
2022-04-08 06:10:39 +00:00
|
|
|
options.packageLoaderConstructorClass = NopePackageLoaderFileAccess;
|
|
|
|
|
|
|
|
return getBrowserPackageLoader(dispatcherOptions, options);
|
2022-01-17 17:06:10 +00:00
|
|
|
}
|