Jahia in English > Disable javascript...

0 (0 Good)
0 (0 Bad)

Disable javascript minification

by  stefanrink »  2012/04/29 10:12

Hello,

how can i suspend or disble the minification of javascript?

  • Disable javascript minification
    2012/04/29 10:12

    stefanrink <p> Hello,</p> <p> how can i suspend or disble the minification of javascript?</p>

  • Number of messages  4
    Registration date Apr 29, 2012
    1 (1 Good)
    0 (0 Bad)

    Re: Disable javascript minification

    by  shyrkov »  2012/04/29 19:17

    Hello Stefan,

    yes, by:

    1) adding the following option into ROOT/WEB-INF/etc/config/jahia.properties file:

    aggregateAndCompressAssets=false

    2) Restarting Jahia

    3) Flushing Jahia output caches (via Jahia Administration / Server Settings / Server and Cache status)

     

    Kind regards

    Sergiy

  • Re: Disable javascript minification
    2014/02/12 15:45

    shyrkov <p> Hello Stefan,</p> <p> yes, by:</p> <p> 1) adding the following option into ROOT/WEB-INF/etc/config/jahia.properties file:</p> <p> aggregateAndCompressAssets=false</p> <p> 2) Restarting Jahia</p> <p> 3) Flushing Jahia output caches (via Jahia Administration / Server Settings / Server and Cache status)</p> <p> &nbsp;</p> <p> Kind regards</p> <p> Sergiy</p>

  • Number of messages  407
    Registration date Apr 29, 2012
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Disable javascript minification

    by  clsip »  2014/02/12 10:33

    Hello,

    Is it possible to just disable JavaScript aggregation ?

     

    Kind regards,

    Clément

  • Re: Re: Disable javascript minification
    2014/02/12 10:33

    clsip <p> Hello,</p> <p> Is it possible to just disable JavaScript aggregation ?</p> <p> &nbsp;</p> <p> Kind regards,</p> <p> Cl&eacute;ment</p>

  • Number of messages  5
    Registration date Feb 12, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Re: Disable javascript minification

    by  shyrkov »  2014/02/12 11:14

    Hello Clément,

     

    no, there is no dedicated flag for JavaScript minification.

    You could only switch the minification for JavaScript and CSS alltogether.

    There is an exclusion list, which you could configure to skip aggregating some resources (like particular JavaScript files, etc.).

     

    Kind regards

    Sergiy

  • Re: Re: Re: Disable javascript minification
    2014/02/12 11:14

    shyrkov <p> Hello Cl&eacute;ment,</p> <p> &nbsp;</p> <p> no, there is no dedicated flag for JavaScript minification.</p> <p> You could only switch the minification for JavaScript and CSS alltogether.</p> <p> There is an exclusion list, which you could configure to skip aggregating some resources (like particular JavaScript files, etc.).</p> <p> &nbsp;</p> <p> Kind regards</p> <p> Sergiy</p>

  • Number of messages  407
    Registration date Feb 12, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Re: Re: Disable javascript minification

    by  clsip »  2014/02/12 12:55

    Hello Sergiy,

    thank you for this response, I'm interesting by this exclusion list…

    How can I configure this list ?

     

    Kind regards,

    Clément

  • Re: Re: Re: Re: Disable javascript minification
    2014/02/12 12:55

    clsip <p> Hello Sergiy,</p> <p> thank you for this response, I&#39;m interesting by this exclusion list&hellip;</p> <p> How can I configure this list ?</p> <p> &nbsp;</p> <p> Kind regards,</p> <p> Cl&eacute;ment</p>

  • Number of messages  5
    Registration date Feb 12, 2014
    1 (1 Good)
    0 (0 Bad)

    Re: Re: Re: Re: Re: Disable javascript minification

    by  shyrkov »  2014/02/12 15:12

    Hello Clément,

     

    you need to override the corresponding Spring bean.

    Please, create the file with the name, say applicationcontext-custom.xml in the <jahia-web-app-dir>/WEB-INF/etc/spring folder with the following content:

     

    <?xml version="1.0" encoding="UTF-8"?>

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

        <bean class="org.jahia.services.render.filter.StaticAssetsFilter">
            <property name="priority" value="0" />
            <property name="description" value="Render filter that 'injects' the static assets into the HEAD section of the rendered HTML document."/>
            <property name="applyOnConfigurations" value="page,gwt" />
            <property name="applyOnTemplateTypes" value="html,edit,html-.*" />
            <property name="scriptEngineUtils" ref="scriptEngineUtils"/>
            <property name="ajaxTemplate" value="/modules/assets/WEB-INF/scripts/ajaxResources.groovy"/>
            <property name="template" value="/modules/assets/WEB-INF/scripts/resources.groovy"/>
            <property name="aggregateAndCompress" value="${aggregateAndCompressAssets:true}"/>
            <property name="excludesFromAggregateAndCompress">
                <list>
                </list>
            </property>
        </bean>

    </beans>
     

     

    The exclusion list (excludesFromAggregateAndCompress) is by default empty.

    You could add desired entries (to be skipped during aggregation) in a way:

    ...

            <property name="excludesFromAggregateAndCompress">
                <list>
                    <value>/modules/mymodule/javascript/my.js</value>
                </list>
            </property>

    ...

     

    Kind regards

    Sergiy

     

  • Re: Re: Re: Re: Re: Disable javascript minification
    2014/02/12 15:45

    shyrkov <p> Hello Cl&eacute;ment,</p> <p> &nbsp;</p> <p> you need to override the corresponding Spring bean.</p> <p> Please, create the file with the name, say applicationcontext-custom.xml in the &lt;jahia-web-app-dir&gt;/WEB-INF/etc/spring folder with the following content:</p> <p> &nbsp;</p> <p> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br /> <br /> &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;<br /> &nbsp;&nbsp;&nbsp; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br /> &nbsp;&nbsp;&nbsp; xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&quot;&gt;<br /> <br /> &nbsp;&nbsp; &nbsp;&lt;bean class=&quot;org.jahia.services.render.filter.StaticAssetsFilter&quot;&gt;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;property name=&quot;priority&quot; value=&quot;0&quot; /&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;description&quot; value=&quot;Render filter that &#39;injects&#39; the static assets into the HEAD section of the rendered HTML document.&quot;/&gt;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;property name=&quot;applyOnConfigurations&quot; value=&quot;page,gwt&quot; /&gt;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;property name=&quot;applyOnTemplateTypes&quot; value=&quot;html,edit,html-.*&quot; /&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;scriptEngineUtils&quot; ref=&quot;scriptEngineUtils&quot;/&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;ajaxTemplate&quot; value=&quot;/modules/assets/WEB-INF/scripts/ajaxResources.groovy&quot;/&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;template&quot; value=&quot;/modules/assets/WEB-INF/scripts/resources.groovy&quot;/&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;aggregateAndCompress&quot; value=&quot;${aggregateAndCompressAssets:true}&quot;/&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;excludesFromAggregateAndCompress&quot;&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;list&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/list&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/property&gt;<br /> &nbsp;&nbsp; &nbsp;&lt;/bean&gt;<br /> <br /> &lt;/beans&gt;<br /> &nbsp;</p> <p> &nbsp;</p> <p> The exclusion list (excludesFromAggregateAndCompress) is by default empty.</p> <p> You could add desired entries (to be skipped during aggregation) in a way:</p> <p> ...</p> <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;excludesFromAggregateAndCompress&quot;&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;list&gt;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;value&gt;/modules/mymodule/javascript/my.js&lt;/value&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/list&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/property&gt;<br /> <br /> ...</p> <p> &nbsp;</p> <p> Kind regards</p> <p> Sergiy</p> <p> &nbsp;</p>

  • Number of messages  407
    Registration date Feb 12, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Re: Re: Re: Re: Disable javascript minification

    by  clsip »  2014/02/12 15:48

    Thanks a lot :)

  • Re: Re: Re: Re: Re: Re: Disable javascript minification
    2014/02/12 15:48

    clsip <p> Thanks a lot :)</p>

  • Number of messages  5
    Registration date Feb 12, 2014
    0 (0 Good)
    0 (0 Bad)

    Fix minification file name

    by  Clément »  2017/02/16 08:09

    Hello,

    I would like to reference the minify css file generated by jahia from another website. Unfortunaly the filename is changed each time the project goes in production so I have to change my <link rel="stylesheet" href="http://../Path-to-minfiyfile.css" /> in each website.

    Is there a web to fix this file name ? It seams that it is generated from StaticAssetsFilter. Is it possible to override the generateAggregateName method ?

    Thanks a lot

    Clément
    Number of messages  1
    Not registered
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page