function createLoadFile(file) {
    const resourcePath = utils_1.cleanImportPath(file.path);
    const attributesAsJsCodeString = file.attributes ? JSON.stringify(file.attributes) : '[]';
    switch (file.type) {
        case utils_1.fileTypes.SCRIPT:
            return `loadScript('${resourcePath}', null, ${attributesAsJsCodeString})`;
        case utils_1.fileTypes.MODULE:
            return `loadScript('${resourcePath}', 'module', ${attributesAsJsCodeString})`;
        case utils_1.fileTypes.SYSTEMJS:
            return `System.import('${resourcePath}')`;
        default:
            throw new Error(`Unknown resource type: ${file.type}`);
    }
}
/**
 * Returns a js statement which loads the given resource in the browser.
 */
Returns a js statement which loads the given resource in the browser.
Returns a js statement which loads the given resource in the browser .
function createLoadFile(file) {
    const resourcePath = utils_1.cleanImportPath(file.path);
    const attributesAsJsCodeString = file.attributes ? JSON.stringify(file.attributes) : '[]';
    switch (file.type) {
        case utils_1.fileTypes.SCRIPT:
            return `loadScript('${resourcePath}', null, ${attributesAsJsCodeString})`;
        case utils_1.fileTypes.MODULE:
            return `loadScript('${resourcePath}', 'module', ${attributesAsJsCodeString})`;
        case utils_1.fileTypes.SYSTEMJS:
            return `System.import('${resourcePath}')`;
        default:
            throw new Error(`Unknown resource type: ${file.type}`);
    }
}
function createLoadFile ( file ) { const resourcePath = utils_1 . cleanImportPath ( file . path ) ; const attributesAsJsCodeString = file . attributes ? JSON . stringify ( file . attributes ) : '[]' ; switch ( file . type ) { case utils_1 . fileTypes . SCRIPT : return ` ${ resourcePath } ${ attributesAsJsCodeString } ` ; case utils_1 . fileTypes . MODULE : return ` ${ resourcePath } ${ attributesAsJsCodeString } ` ; case utils_1 . fileTypes . SYSTEMJS : return ` ${ resourcePath } ` ; default : throw new Error ( ` ${ file . type } ` ) ; } }
Returns a js statement which loads the given resource in the browser.
Returns a js statement which loads the given resource in the browser .