ui5-task-minify-xml
v3.1.3
Published
UI5 task for minifying XML resources (like views, fragments, etc.)
Readme
UI5 task for minifying XML resources (like views, fragments, etc.)
:wave: This is an open‑source, community‑driven project, developed and actively monitored by members of the UI5 community. You are welcome to use it, report issues, contribute enhancements, and support others in the community.
Task for ui5-builder, enabling XML minification based on minify-xml.
Prerequisites
- Requires at least
@ui5/[email protected](to supportspecVersion: "3.0")
:warning: UI5 CLI Compatibility All releases of this UI5 CLI extension using the major version
3require UI5 CLI V3. Any previous releases below major version3(if available) also support older versions of the UI5 CLI. But the usage of the latest UI5 CLI is strongly recommended!
Install
npm install ui5-task-minify-xml --save-devConfiguration options (in $yourapp/ui5.yaml)
minifyOptions:
Objectall options available from the minify-xml plugin, with one additional (non-compliant)collapseWhitespaceInAttributeValues(boolean) option, due to UI5 having a lot of options (e.g. with JSON values) where collapsing whitespace is beneficial. defaults to all standard options ofminify-xmlandcollapseWhitespaceInAttributeValuesenabled.fileExtensions:
String|Array<String>the file extensions to glob for. defaults toxml.excludePatterns:
Array<String>array of paths inside$yourapp/to exclude from the minification, e.g. 3-rd party libs inlib/*. defaults to an empty array[].
Usage
- Define the dependency in
$yourapp/package.json:
"devDependencies": {
// ...
"ui5-task-minify-xml": "*"
// ...
}- configure it in
$yourapp/ui5.yaml:
builder:
customTasks:
- name: ui5-task-minify-xml
afterTask: replaceVersion
configuration:
minifyOptions:
removeComments: true
collapseEmptyElements: true
collapseWhitespaceInAttributeValues: true
# ... further minify-xml attributes
fileExtensions:
- "xml"
- "edmx"
excludePatterns:
- "lib/"
- "another/dir/in/webapp"
- "yet/another/dir"License
This work is licensed under the Apache 2.0 license.
