How to minify CSS and JS in Liferay 7.4? As liferay portal properties are deprecated in 7.4 version

1.1k views Asked by At

I've just upgraded our customer's liferay environment from 7.3 to 7.4 CE. In earlier version I was using properties theme.css.fast.load=true and javascript.fast.load=true. But as liferay says here that these properties are deprecated now. Any idea how to achieve it now?

1

There are 1 answers

1
Olaf Kock On

The document that you link does not contain any mention of "fast.load", but it has a section on Minification:

Disabled Runtime Minification of CSS and JavaScript Resources by Default

What changed?

The minifier.enable portal property now defaults to false. Instead of performing minification of CSS and JS resources at run time, we prepare pre-minified resources at build time. There should be no user-visible changes in page styles or logic. Who is affected?

This affects you if your implementations depend on the runtime minifier (usually the Google Closure Compiler). How should I update my code?

If you want to maintain the former runtime minification behavior, set the minifier.enable portal property to true.

Why was this change made?

Moving frontend resource minification from run time to build time reduces server load and facilitates using the latest minification technologies available within the frontend ecosystem.