👋 This is a community project and there is no official support for this package! Feel free to use it, open issues, contribute, and help answering questions.
Task for ui5-builder, enabling XML minification based on minify-xml.
- Requires at least
@ui5/cli@3.0.0
(to supportspecVersion: "3.0"
)
⚠️ UI5 Tooling Compatibility All releases of this tooling extension using the major version3
require UI5 Tooling V3. Any previous releases below major version3
(if available) also support older versions of the UI5 Tooling. But the usage of the latest UI5 Tooling is strongly recommended!
npm install ui5-task-minify-xml --save-dev
-
minifyOptions:
Object
all 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-xml
andcollapseWhitespaceInAttributeValues
enabled. -
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[]
.
- 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"
This work is licensed under the Apache 2.0 license.