Class: URLBuilder

URLBuilder

new URLBuilder(configParser)

Creates an instance of URLBuilder class.
Parameters:
Name Type Description
configParser object instance of ConfigParser object.
Source:

Methods

_generateBufferURLs(modules, urls, config) → {Array.<Object>}

Generate the appropriate set of URLs based on the list of required modules and the maximum allowed URL length
Parameters:
Name Type Description
modules Array.<String> Array of module names
urls Array.<String> Array of module URLs
config Object Configuration object containing URL, basePath and urlMaxLength
Source:
Returns:
Resulting array of {modules, url} objects
Type
Array.<Object>

<protected> _getModulePath(module) → {string}

Returns the path for a module. If module has property path, it will be returned directly. Otherwise, the name of module will be used and extension .js will be added to module name if omitted.
Parameters:
Name Type Description
module object The module which path should be returned.
Source:
Returns:
Module path.
Type
string

build(modules) → {array}

Returns a list of URLs from provided list of modules.
Parameters:
Name Type Description
modules array List of modules for which URLs should be created.
Source:
Returns:
List of URLs.
Type
array