New Javascript minification disabling option in eXo Platform 5.0

Thanks to its built-in Javascript module support, eXo Platform allows to easily integrate any custom or third-party Javascript. The script must be declared in the file WEB-INF/gatein-resources.xml of your extension webapp:

and can then be injected in any other page, portlet or other script:

The declared javascript files are automatically minified to reduce their size and therefore the size of resources fetched in web pages. This is a good practice but it can cause issues when the script is not compatible with the minifier used in eXo Platform (Google Closure Compiler). For example, this issue has been discovered for React.js (chapter “Incompatibility with the GateIn minifier”).
In eXo Platform 5.0 we added a new option in the Javascript module configuration to disable the minification: minify. The default value is set to true to keep backward compatibility.

When the minify option is set to false, the script is injected as is, without any alteration. It allows to package your already minified script, with the source map files, using your favorite tool (webpack, …).

We believe this will make third parties’ Javascript libraries easier to integrate and therefore improve the developers’ experience.

Related Posts

I am a software architect at eXo. With the developers, I (try to) convert technically what the product management people have in their minds. I also assist the support team in answering customers’ questions. In this blog, I share what we develop in the platform and provide tips to help customers to use or customise it.

Comments
Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">