1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-26 16:20:09 +02:00

load monaco dependencies asyncly

This commit is contained in:
Kushagra Gour
2018-12-09 23:08:51 +05:30
parent b48b6a2910
commit bae1983ca5
2 changed files with 32 additions and 9 deletions

View File

@@ -305,6 +305,18 @@ export function loadJS(src) {
return d.promise;
}
export function loadCss(src) {
var d = deferred();
var style = window.document.createElement('link');
style.setAttribute('href', src);
style.setAttribute('rel', 'stylesheet');
document.head.appendChild(style);
style.onload = function() {
d.resolve();
};
return d.promise;
}
/* eslint-disable max-params */
export function getCompleteHtml(html, css, js, item, isForExport) {
/* eslint-enable max-params */