Skip to content

@ui5/builder/processors/minifier

Methods

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

Description: Minifies the supplied resources.

Source: builder/lib/processors/minifier.js, line 139

Parameters:
NameTypeDescription
parametersobjectParameters
Properties:
NameTypeAttributesDescription
resourcesArray<@ui5/fs/Resource>List of resources to be processed
fsfs | module:@ui5/fs/fsInterfaceNode fs or custom
fs interface. Required when setting "readSourceMappingUrl" to true
taskUtil@ui5/builder/tasks/TaskUtil | objectoptionalTaskUtil instance.
Required when using the useWorkers option
optionsobjectoptionalOptions
Properties
NameTypeAttributesDefaultDescription
readSourceMappingUrlbooleanoptionalfalseWhether 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.
addSourceMappingUrlbooleanoptionaltrueWhether to add a sourceMappingURL reference to the end of the minified resource
useWorkersbooleanoptionalfalseWhether 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: builder/lib/processors/minifier.js, line 129

Properties:
NameTypeDescription
resource@ui5/fs/ResourceMinified resource
dbgResource@ui5/fs/ResourceDebug (non-minified) variant
sourceMap@ui5/fs/ResourceSource Map

Result set

Type:
  • object