UI5 task for minifying XML resources (like views, fragments, etc.)
npm install ui5-task-minify-xml> :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.
- Requires at least @ui5/cli@3.0.0 (to support specVersion: "3.0")
> :warning: UI5 CLI Compatibility
> All releases of this UI5 CLI extension using the major version 3 require UI5 CLI V3. Any previous releases below major version 3 (if available) also support older versions of the UI5 CLI. But the usage of the latest UI5 CLI is strongly recommended!
``bash`
npm install ui5-task-minify-xml --save-dev
)- minifyOptions: ObjectcollapseWhitespaceInAttributeValues
all options available from the minify-xml plugin, with one additional (non-compliant) (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 of minify-xml and collapseWhitespaceInAttributeValues enabled.
- fileExtensions: String|Arrayxml
the file extensions to glob for. defaults to .
- excludePatterns: Array $yourapp/
array of paths inside to exclude from the minification, e.g. 3-rd party libs in lib/*. defaults to an empty array [].
1. Define the dependency in $yourapp/package.json:
`json`
"devDependencies": {
// ...
"ui5-task-minify-xml": "*"
// ...
}
2. configure it in $yourapp/ui5.yaml:
`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"
This work is licensed under the Apache 2.0 license.