creator如何加载并使用远程TS

目前我的项目有一个需求,加载远程的TS并调用。参考了百度出的一些方法,都无法正常实现。

方法1:

let url = "https://cocosupdate.oss-cn-hangzhou.aliyuncs.com/opt/cocos-hot-update/ZWWIOS/GuideNew2.ts";

    cc.loader.load(url, function (err, res) {
        if (err) {
            cc.error(err);
            return;
        }

        cc.log("res",res);

        eval("Guide()");

    });

方法2:
// 加载代码
let url = “http://远程域名或ip地址/路径/TestRemote.js”;
cc.loader.load(url, (err, res) => {
if (err) {
console.error(err);
} else {
// 1. 普通函数可以直接调用
Print(“Hello World”);

    // 2. 继承cc.Component的类
    let clsName = "TestRemote";// 自己定义,需要和TestRemote.js文件中类名一致
    let cls = cc.js.getClassByName(clsName);
    if (!cls) {
        let remoteCls: any = window[clsName];
        if (window.__modular) {
            // preview
            window.__modular.modules[clsName] = {
                file: clsName
            };
            window.__modular.nameMap[clsName] = clsName;
        }
        if (window.__require) {
            // build
        }
        let o = function (r) {
            var u = {
                exports: {}
            };
            remoteCls[0].call(u.exports, function (t) {
                return o(remoteCls[1][t] || t)
            }, u, u.exports);
            return u.exports
        }
        o(clsName);
    }
    let node = new cc.Node();
    node.parent = this.node;
    node.setPosition(0, 100);
    let com = node.addComponent("TestRemote");
    let labelNode = new cc.Node();
    labelNode.parent = node;
    com.label = labelNode.addComponent(cc.Label);
    com.setLabel("Hahaha");

    console.log('done');
}

});

https://blog.csdn.net/GrimRaider/article/details/107154683

请问有人实现过吗,求教。