diff --git a/lib/core/src/dom/get-lib.ts b/lib/core/src/dom/get-lib.ts index 7ef496e004..586fe13055 100644 --- a/lib/core/src/dom/get-lib.ts +++ b/lib/core/src/dom/get-lib.ts @@ -196,7 +196,7 @@ $.getLib = async function (optionsOrSrc: string | string[] | GetLib } const {root = $.libRoot} = options; - await Promise.all(srcList.map(srcOptions => { + for (let srcOptions of srcList) { if (typeof srcOptions === 'string') { srcOptions = {src: srcOptions}; } @@ -210,10 +210,11 @@ $.getLib = async function (optionsOrSrc: string | string[] | GetLib src, }; if (srcOptions.type === 'css' || (!srcOptions.type && src.endsWith('.css'))) { - return loadCSS(loadOptions as LoadCSSOptions); + await loadCSS(loadOptions as LoadCSSOptions); + return; } - return loadJS(loadOptions as LoadJSOptions); - })); + await loadJS(loadOptions as LoadJSOptions); + } return onSuccess(); };