liferay / liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18 stars 24 forks source link

Unable to minify aui.css #63

Closed kboucher closed 7 years ago

kboucher commented 7 years ago

I recently added some gulp tasks to my Liferay DXP theme project to concatenate and minify our theme's JavaScript files and to minimize the main.css file generated by the liferay-theme-tasks build process.

However I have been unable to successfully minify the generated aui.scss file. I even tried hooking into the before:build:war hook to no avail.

Is this something that can be supported by liferay-theme-tasks or is that outside the scope of this project?

robframpton commented 7 years ago

Hey @kboucher

With the correct Portal properties set, the css files should be minified by Portal. Meaning we wouldn't need to minify them during the build process.

Do you know what Portal properties you are using?

kboucher commented 7 years ago

These are from my dev environment. I don't handle the production deployments, but it would be great to know what settings I need to make sure all CSS assets are minified. Thx!

theme.css.fast.load=false
theme.css.fast.load.check.request.parameter=true
theme.images.fast.load=false
theme.images.fast.load.check.request.parameter=true

javascript.fast.load=true
javascript.log.enabled=false
javascript.single.page.application.enabled=false

layout.template.cache.enabled=false

browser.launcher.url=

combo.check.timestamp=true

freemarker.engine.cache.storage=soft:1
freemarker.engine.resource.modification.check.interval=0

minifier.enabled=false

openoffice.cache.enabled=false

velocity.engine.resource.modification.check.interval=0

com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.etag.ETagFilter=false
com.liferay.portal.servlet.filters.header.HeaderFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true
robframpton commented 7 years ago

Hey @kboucher

I believe you would need to set the following for the css minification to take place.

theme.css.fast.load=true

minifier.enabled=true
robframpton commented 7 years ago

Also here are some links to the relevant Portal properties documentation.

https://docs.liferay.com/portal/7.0/propertiesdoc/portal.properties.html#Theme https://docs.liferay.com/portal/7.0/propertiesdoc/portal.properties.html#Minifier

kboucher commented 7 years ago

Awesome, thanks I will try that!

kboucher commented 7 years ago

Worked like a charm (well, except the Liferay minifier leaves comments in the aui.css), but I guess that's as good as it gets.

Thanks again!