mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+6
-5
@@ -32,7 +32,7 @@ kit.config = kit.config || {};
|
||||
*/
|
||||
var MD_TYPE = { // module definition
|
||||
ES: 'ES', // CMAScript2020 or ES11
|
||||
UMD: 'UMD', // https://github.com/umdjs/umd
|
||||
UMD: 'UMD', // https://github.com/umdjs/umd // Node/CommonJS
|
||||
HMD: 'HMD', // HandlerMD - function(require, exports, module, global){module.exports = {}; return {};}
|
||||
default: 'default',
|
||||
};
|
||||
@@ -553,10 +553,7 @@ kit.config = kit.config || {};
|
||||
self.config.debug && console.log(`Plugin ${self.id}: load script ${src}`);
|
||||
|
||||
var script = document.createElement('script');
|
||||
script.src = src;
|
||||
if(self.config.isSetTimestamp){
|
||||
script.src = getUrlWithTimestamp(src);
|
||||
}
|
||||
script.async = true;
|
||||
script.onload = function() {resolve(script);};
|
||||
script.onerror = function() {
|
||||
var error = new Error(`Ошибка загрузки скрипта ${src}`);
|
||||
@@ -564,6 +561,10 @@ kit.config = kit.config || {};
|
||||
console.log(`%cPlugin.load(${self.id}): error load script ${src}!`, "color: red;");
|
||||
reject(error);
|
||||
};
|
||||
script.src = src;
|
||||
if(self.config.isSetTimestamp){
|
||||
script.src = getUrlWithTimestamp(src);
|
||||
}
|
||||
document.head.append(script);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user