Class: ConfigParser

ConfigParser

new ConfigParser(config)

Creates an instance of ConfigurationParser class.
Parameters:
Name Type Argument Description
config object <optional>
The configuration object to be parsed.
Source:

Methods

<protected> _parseConfig(config) → {object}

Parses configuration object.
Parameters:
Name Type Description
config object Configuration object to be parsed.
Source:
Returns:
The created configuration
Type
object

<protected> _parseModules(modules) → {object}

Parses a provided modules configuration.
Parameters:
Name Type Description
modules object Map of modules to be parsed.
Source:
Returns:
Map of parsed modules.
Type
object

<protected> _registerConditionalModule(module)

Registers conditional module to the configuration.
Parameters:
Name Type Description
module object Module object
Source:

addModule(module)

Adds a module to the configuration.
Parameters:
Name Type Description
module object The module which should be added to the configuration. Should have the following properties:
    Obligatory properties:
  • name (String) The name of the module
  • dependencies (Array) The modules from which it depends
Optional parameters: The same as those which config parameter of Loader#define method accepts.
Source:

getConditionalModules() → {object}

Returns map with all currently registered conditional modules and their triggers.
Source:
Returns:
Map with all currently registered conditional modules.
Type
object

getConfig() → {object}

Returns the current configuration.
Source:
Returns:
The current configuration.
Type
object

getModules() → {object}

Returns map with all currently registered modules.
Source:
Returns:
Map with all currently registered modules.
Type
object

<protected> mapModule(module) → {array|string}

Maps module names to their aliases. Example: __CONFIG__.maps = { liferay: 'liferay@1.0.0' } When someone does require('liferay/html/js/ac.es',...), if the module 'liferay/html/js/ac.es' is not defined, then a corresponding alias will be searched. If found, the name will be replaced, so it will look like user did require('liferay@1.0.0/html/js/ac.es',...).
Parameters:
Name Type Description
module array | string The module which have to be mapped or array of modules.
Source:
Returns:
The mapped module or array of mapped modules.
Type
array | string