Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Yehuda Abramov
Js files inside portal_normal.vm are not minfified
February 17, 2013 7:09 AM
Answer

Yehuda Abramov

Rank: New Member

Posts: 2

Join Date: February 17, 2013

Recent Posts

Hi,
We have two type includes of js files in our portal.
The files that inlcuded via liferay-portlet.xml.
Another files that we want they to be in each page included in portal_normal.vm.
The problem is the files that included by portal_normal.vm are not minified.
Is there any solution to get them minified?
Manali Lalaji
RE: Js files inside portal_normal.vm are not minfified
February 17, 2013 10:30 PM
Answer

Manali Lalaji

Rank: Expert

Posts: 362

Join Date: March 9, 2010

Recent Posts

Hi Yehuda,

Instead of including files in portal_normal.vm, you can specify the sequence of js files to be included in build-common-theme.xml and write code to combine selected js files in one file.

In build-common-plugin.xml, you can write the code for minification.

HTH,
Manali
Yehuda Abramov
RE: Js files inside portal_normal.vm are not minfified
February 18, 2013 12:27 AM
Answer

Yehuda Abramov

Rank: New Member

Posts: 2

Join Date: February 17, 2013

Recent Posts

Hi Manali,
Thank you for response.
I want the files be minified by built-in minifier.
The files that included in liferay-portlet.xml.is handled by minifier.
I need exactly the same to files that inside portal_normal.vm.
sricanth arroju
RE: Js files inside portal_normal.vm are not minfified
February 18, 2013 1:26 AM
Answer

sricanth arroju

Rank: Regular Member

Posts: 130

Join Date: October 2, 2009

Recent Posts

Hi

use minifier to compress the js and use the same in portlet normal.vm and liferay-portlet.xml
Richard Lee
RE: Js files inside portal_normal.vm are not minfified
August 15, 2013 4:53 PM
Answer

Richard Lee

Rank: Junior Member

Posts: 28

Join Date: January 18, 2011

Recent Posts

Another poorly documented feature for Liferay CE.... After much trial and error and digging through the default themes I found you can actually minify your scripts via Velocity and I've now done this for a few LR 6.0.6 projects now by placing the following within my init_custom.vm or a separate file I call js.vm :

1#set($common_js = $htmlUtil.escape($portalUtil.getStaticResourceURL($request, "$javascript_folder/common.js")))
Richard Lee
RE: Js files inside portal_normal.vm are not minfified
August 15, 2013 6:15 PM
Answer

Richard Lee

Rank: Junior Member

Posts: 28

Join Date: January 18, 2011

Recent Posts

FYI I did try to create a #macro() for this, however I noticed any changes I made to the macro we're being reflected due to caching so I abandoned the idea!