This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
import {LoaderContext, LoaderCallback} from '..';
import {normalizeOptions, getResources, injectResources} from '.';
export const loadResources = async (ctx: LoaderContext, source: string, callback: LoaderCallback) => {
try {
const options = normalizeOptions(ctx);
const resources = await getResources(ctx, options);
const content = await injectResources(options, source, resources);
return callback(null, content);
} catch (err) {
return callback(err);
}
};