[INTERNAL] Use clean-css for compression instead of less.js with compress#360
[INTERNAL] Use clean-css for compression instead of less.js with compress#360tobiasso85 wants to merge 9 commits intov2from
Conversation
|
Could you add some context for those who where not involved in the discussion? (like me 🥺) Questions: Is file size reduction the only motivation for this change? What is the reason for for having two parameters, |
You're right, let's discuss this again with all. This is also more trying out this solution. It was taken into account because:
|
|
As discussed, closing this PR. |
|
As it turnes out, the less compression feature has serious bugs. See SAP/less-openui5#112 Switching to clean-css might resolve those with little performance penalty. |
|
Rebased onto current master and resolved conflicts. There are still failing tests (different CSS output than expected) however, an expert should check for the correctness of the new output. |
"/* Inline theming parameters */" comment is hard coded in less-openui5, but should not be present when compressed.
Add test to ensure css statements are valid with regards to "calc"-function being called with "0px". Compression should not transform "0px" to "0" within calc statement.
Increases coverage
Add color optimization example to compressiontheme test.
compress parameter should not be used but rather a combination of cssOptimizer on CSS resources and compressJSON parameter should be used instead.
| * @param {module:@ui5/fs.Resource[]} resources Library files | ||
| * @param {Object} [options] Build options | ||
| * @param {boolean} [options.compress=false] Compress build output (CSS / JSON) | ||
| * DEPRECATED: Use [cssOptimizer]{@link module:@ui5/builder.processors.cssOptimizer} to compress CSS output. |
There was a problem hiding this comment.
A warning log in the code would also be reasonable. Similar to https://github.com/SAP/ui5-fs/blob/master/lib/resourceFactory.js#L72
Introduce separate CSS optimization processor such that it can be used standalone, e.g. when serving files in ui5 server and to have a better css compression
Fixes shortcomings of less.js css compression. Compiler option
compresswas deprecated and produced invalid css when usingcalcwith0px.