@ui5/builder/processors/minifier

Methods

(static) default(parameters) → {Promise.<Array.<module:@ui5/builder/processors/minifier~MinifierResult>>}

Description:
  • Minifies the supplied resources.
Source:
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
resources Array.<@ui5/fs/Resource> List of resources to be processed
fs fs | module:@ui5/fs/fsInterface Node fs or custom fs interface. Required when setting "readSourceMappingUrl" to true
taskUtil @ui5/builder/tasks/TaskUtil | object <optional>
TaskUtil instance. Required when using the useWorkers option
options object <optional>
Options
Properties
Name Type Attributes Default Description
readSourceMappingUrl boolean <optional>
false Whether to make use of any existing source maps referenced in the resources to be minified. Use this option to preserve references to the original source files, such as TypeScript files, in the generated source map.
If a resource has been modified by a previous task, any existing source map will be ignored regardless of this setting. This is to ensure that no inconsistent source maps are used. Check the verbose log for details.
addSourceMappingUrl boolean <optional>
true Whether to add a sourceMappingURL reference to the end of the minified resource
useWorkers boolean <optional>
false Whether to offload the minification task onto separate CPU threads. This often speeds up the build process
Returns:
Promise resolving with object of resource, dbgResource and sourceMap
Type
Promise.<Array.<module:@ui5/builder/processors/minifier~MinifierResult>>

Type Definitions

MinifierResult

Description:
  • Result set
Source:
Properties:
Name Type Description
resource @ui5/fs/Resource Minified resource
dbgResource @ui5/fs/Resource Debug (non-minified) variant
sourceMap @ui5/fs/Resource Source Map
Result set
Type:
  • object