當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript requirejs-shim.require類代碼示例

本文整理匯總了TypeScript中@hpcc-js/requirejs-shim.require的典型用法代碼示例。如果您正苦於以下問題:TypeScript require類的具體用法?TypeScript require怎麽用?TypeScript require使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了require類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: dev

export function dev(additionalPaths: { [key: string]: string } = {}): any {
    window.__hpcc_topoJsonFolder = `${hostUrl}/map/TopoJSON`;
    const thirdPartyPaths: { [key: string]: string } = {};
    for (const key in npmPackages) {
        thirdPartyPaths[key] = `${hostUrl}/../node_modules/${npmPackages[key]}`;
    }
    const paths: { [key: string]: string } = {
        ...thirdPartyPaths,
        ...additionalPaths
    };
    const rjsPackages: any = [];
    hpccShims.forEach(shim => {
        paths[`@hpcc-js/${shim}`] = `${hostUrl}/${shim}/dist/index`;
    });
    packages.forEach(pckg => {
        paths[`@hpcc-js/${pckg}`] = `${hostUrl}/${pckg}`;
        rjsPackages.push({
            name: `@hpcc-js/${pckg}`,
            main: "lib-umd/index"
        });
    });
    return requirejs.config({
        context: hostUrl,
        paths,
        packages: rjsPackages,
        shim: requireShims
    });
}
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:28,代碼來源:requirejs.ts

示例2: reqListener

 function reqListener() {
     const pkg = JSON.parse(this.responseText);
     console.log(`Configuring require from ${pkg.name}@${pkg.version} from ${url}`);
     const topoJsonUrl = `${pkgUrl(pkg, "@hpcc-js/map")}/TopoJSON`;
     window.__hpcc_topoJsonFolder = topoJsonUrl;
     const paths: { [key: string]: string } = {
         "@hpcc-js/map/TopoJSON": topoJsonUrl,
         ...additionalPaths
     };
     for (const key in pkg.dependencies) {
         paths[key] = `${pkgUrl(pkg, key)}/dist/index${minStr}`;
     }
     resolve(requirejs.config({
         context: url,
         paths
     }));
 }
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:17,代碼來源:requirejs.ts

示例3: cdn

export function cdn(url: string, min: boolean = true, additionalPaths: { [key: string]: string } = {}): any {
    console.log("Deprecated - please use 'amd'");
    window.__hpcc_topoJsonFolder = `${url}/map/TopoJSON`;
    const minStr = min ? ".min" : "";
    const paths: { [key: string]: string } = {
        "@hpcc-js/map/TopoJSON": `${url}/map/TopoJSON`,
        ...additionalPaths
    };
    hpccShims.forEach(shim => {
        paths[`@hpcc-js/${shim}`] = `${url}/${shim}/dist/index${minStr}`;
    });
    packages.forEach(pckg => {
        paths[`@hpcc-js/${pckg}`] = `${url}/${pckg}/dist/index${minStr}`;
    });
    return requirejs.config({
        context: url,
        paths
    });
}
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:19,代碼來源:requirejs.ts


注:本文中的@hpcc-js/requirejs-shim.require類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。