yui-compressor

ant + yuicompressor path error

偶尔善良 提交于 2021-02-07 12:47:29
问题 I've got a file in C:\Bin\test.js that I would like to compress and have renamed test-min.js my ant build.xml looks like this: <property name="temp.dir" value="C:\Bin\"/> <apply executable="java" parallel="false" dest="${temp.dir}"> <fileset dir="${temp.dir}" includes="test.js"/> <arg line="-jar"/> <arg path="${yui.dir}"/> <srcfile/> <arg line="-o"/> <mapper type="glob" from="*.js" to="*-min.js"/> <targetfile/> </apply> I get the following Java error: [apply] java.io.FileNotFoundException:

Minify and obfuscate JavaScript code in Java

情到浓时终转凉″ 提交于 2021-01-27 12:44:52
问题 I use YUI Compressor for years to minify and obfuscate JS files. But now I need to obfuscate and minify dynamically generated JavaScript code on the server. So the main difference here is that there will not be JS files that should be obfuscated but requests to the server (Java) which should generate portions of JS code and return them already minified and obfuscated. YUI Compressor does not give the possibility to do that. I watched in the sources and have already figured out what methods

Minify HTML files in text/html templates

做~自己de王妃 提交于 2020-01-14 10:32:35
问题 I use mustache/handlebar templates. eg: <script id="contact-detail-template" type="text/html"> <div>... content to be compressed </div> </script> I am looking to compress/minify my HTML files in the templates for the best compression. YUIcompressor, closure does not work as they think that it is script and gives me script errors. HTMLCompressor does not touch them even as it thinks that it is a script. How do I minify the content in the script tags with type text/html? Can I use a library? If

Determine which file has an error when running YUI compressor from Ant

≡放荡痞女 提交于 2020-01-02 01:19:26
问题 We compress our javascript (and css files) with YUI compressor during our ant build task running on our Jenkins CI Server. However, it is very difficult to determine which js files YUI compressor is having errors with. We see a bunch of things like: [minify-js] [ERROR] 3:35:unterminated string literal [minify-js] [minify-js] [ERROR] 3:35:syntax error [minify-js] [minify-js] [ERROR] 4:8:syntax error [minify-js] [minify-js] [ERROR] 1:0:Compilation produced 3 syntax errors. [minify-js] org

YUICompressor or similar in PHP?

狂风中的少年 提交于 2020-01-01 03:03:09
问题 I've been using yuicompressor.jar on my test server for on-the-fly minimisation of changed JavaScript files. Now that I have deployed the website to the public server, I noticed that the server's policies forbid the use of exec() or its equivalents, so no more java execution for me. Is there a decent on-the-fly JS compressor implemented in PHP? The only thing resembling this that I was able to find was Minify, but it's more of a full-blown compression solution with cache and everything. I

YUICompressor or similar in PHP?

时光怂恿深爱的人放手 提交于 2020-01-01 03:03:07
问题 I've been using yuicompressor.jar on my test server for on-the-fly minimisation of changed JavaScript files. Now that I have deployed the website to the public server, I noticed that the server's policies forbid the use of exec() or its equivalents, so no more java execution for me. Is there a decent on-the-fly JS compressor implemented in PHP? The only thing resembling this that I was able to find was Minify, but it's more of a full-blown compression solution with cache and everything. I

yuicompressor maven plugin and maven-war-plugin

守給你的承諾、 提交于 2019-12-29 14:21:32
问题 I've been struggling with getting this plugin to play nicely with the maven-war-plugin for a couple of hours now and I thought it was time to ask for help. I have the plugin defined as follows: <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>yuicompressor-maven-plugin</artifactId> <version>1.3.0</version> <executions> <execution> <id>compressyui</id> <phase>process-resources</phase> <goals> <goal>compress</goal> </goals> <configuration> <nosuffix>true</nosuffix> <warSourceDirectory

Skip License/Credit Comments when minifying JavaScript using YUIcompressor

◇◆丶佛笑我妖孽 提交于 2019-12-23 07:46:51
问题 Is there a way to keep license/credit comments when the JavaScript is being minified by YUICompressor? Is there any special commenting characters? Or any flag for that in YUICompressor? Thanks, Grace 回答1: Yes, use /*! * */ The exclamation tells the compressor to retain the comment. Documentation 来源: https://stackoverflow.com/questions/6614532/skip-license-credit-comments-when-minifying-javascript-using-yuicompressor

Why is Google PageSpeed Insights telling me to minify javascript & CSS (using Rails 3.2 with JS & CSS compression) and how to fix?

▼魔方 西西 提交于 2019-12-20 21:56:33
问题 I know it's not a lot I could save in KB, but to achieve a better score in Google PageSpeed Insights, and thus probably better SEO ranking, how can I fix this? From https://developers.google.com/speed/pagespeed/insights/?hl=en&url=www.tradebench.com : Minify JavaScript for the following resources to reduce their size by 2.8KiB (2% reduction). Minifying http://d2bfamm4k6zojq.cloudfront.net/…tion-ea806932c941fb875b7512a557ebead3.js could save 2.8KiB (2% reduction) after compression. It tells me

How many globals make sense to be passed to the IIFE wrapper?

痞子三分冷 提交于 2019-12-20 03:52:37
问题 To which extent does it make sense to pass plenty of global values to an IIFE? The common thing is just to pass 3 as far as I see everywhere (window, document and undefined). But... would it make sense to pass more if they are used more than 10 times in the code just for the fact of minification? In my case I found the global variable Math 14 times in the code. It would make sense to pass it to an IIFE in order to save 42 bytes. Which in this case is not a lot, but if we sum bit by bit