简体   繁体   中英

Liferay 7 - How to minify the js used in the portlet?

I am using Liferay 7.0 and I have a custom js used in the portlet level which is one giant file. I'm getting issues during the compilation owing to the size (code too large for try block). If I minify the file manually and deploy it works (but this is not going to help). Is there a way to minify the js from the portlet level during deployment?

I know the theme minifies the js but the custom one is tightly coupled and not usable for other portlets, so I can't move the file into the theme.

Thanks

"code too large for try block"?

I'd not look for minifiers, but rather decompose it and extract a couple of functions from code within that block.

Should get rid of that problem, documents better what you're doing (by providing a function name) and eases maintenance. Win-win-win

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM