Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to minify JavaScript files that contains a function name separated with a '.'?
    primarykey
    data
    text
    <p>I am minfying 100's of Javascript files on a windows OS and ran into a issue with almost half of them. It turns out that the minfiying compressor cannot properly minify js files that has a function spearated by a dot. For the YUI compressor it deletes the contents of the file when such a situation happens, and for Ajaxminifier, it just ignores the dot and take the function name before it.</p> <p>Example of the function in question:</p> <pre><code>function window.onload() {} Error Message: :missing ( before function parameters </code></pre> <p>Using the YUI compressor as an MSBuild task and command line both yeild the same results.</p> <p>Command line example:</p> <pre><code>java -jar yuicompressor.jar --type js --charset utf-8 -o D:\foo.js D:\foo-min.js </code></pre> <hr> <p>Using the Ajax Minifier example:</p> <p>Command line:</p> <pre><code>AjaxMin.exe -o D:\foo.js D:\foo-min.js </code></pre> <hr> <p>However, one solution is to rewrite the function and the minification process works great Example:</p> <pre><code>window.onload = function() {} </code></pre> <p>But this is not an option for us, right now. Does anyone know about this problem and able to provide a solution?</p> <hr> <p>Thanks. Yes, I did inherit these files and I am yet to determine why it was written this way. I dont believe there is any processor that converts it to proper JS..I do know that the web app only runs on IE, this may be the reason why this is working. On firefox etc, it may not be the case.I am looking to get this changed</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload