🔥 Refactor struct & code for loading 3rd scripts.

This commit is contained in:
凡梦星尘
2022-10-27 15:57:42 +08:00
parent 9160a33053
commit 0d1b00f7b0
21 changed files with 302 additions and 210 deletions

View File

@@ -179,9 +179,10 @@ NexT.utils = {
getCDNResource: function (res) {
let { plugins, router } = NexT.CONFIG.vendor;
let { name, version, file, alias } = res;
let { name, version, file, alias, alias_name } = res;
let npm_name = name;
if (alias_name) npm_name = alias_name;
let res_src = '';
switch (plugins) {
case 'cdnjs':
@@ -522,7 +523,6 @@ NexT.utils = {
link.setAttribute('href', src);
const head = (parent || document.head);
console.log(head)
if (position === 'before') {
head.prepend(link);
} else {