Issue
-
Combo servlet bundles/aggregates multiple CSS files into single downloads. Some of those CSS files might already have been minified, so those are not minified again.
Apart from bundling multiple files, the
Combo
servlet also translates relative URLs used in CSS files so that they still work even though the location of the CSS file is now different (/combo?.... instead of/o/my-portlet/css/
)The issue is: if an already minified CSS file contains a relative URL, this relative URL is not translated (because the file is skipped completely).
- See LPS-128528 for a test-case and reproduction steps.
Environment
- Liferay DXP 7.0+
Resolution
- To work the issue around, please use extensions for CSS files that are different from
-min.css
or.min.css
Additional Information
- Based on ComboServlet.java, particularly this snippet:
if (!StringUtil.endsWith(resourcePath, _CSS_MINIFIED_DASH_SUFFIX) &&
The behavior is expected.
!StringUtil.endsWith(resourcePath, _CSS_MINIFIED_DOT_SUFFIX) &&
!StringUtil.endsWith(
resourcePath, _JAVASCRIPT_MINIFIED_DASH_SUFFIX) &&
!StringUtil.endsWith(
resourcePath, _JAVASCRIPT_MINIFIED_DOT_SUFFIX))