yui-compressor

How to preserve comments with YUI compressor

I'm using the YUI compressor to merge and minify my JS-files. One problem I'm having is that comments are being deleted, even though I'm using the suggested format as follows: /*! comments go here */ That's what they say in the documentation and on several blogs: http://www.julienlecomte.net/yuicompressor/README http://www.electrictoo...

YUI compressor not behaving as expected

Hi I tried compressing a JavaScript file of mine using YUI compressor, but somehow it did not do what was expected. The JavaScript file is here. The compressed output looked like this: !window.$j&&(function($){$.jswaf={};$j=$.jswaf;var resources={},modules={},depends={},events={},eventfired={},modulepath={},themepath={}; [...] ...

Combined JS File Using YUICompressor Causing Errors

I'm combining multiple js files using YUI Compressor. The command works successfully and outputs a combined file properly. When I point my page to it, however, it doesn't seem to be read properly and I get this error in the Javascript error console. YAHOO is not defined I've tried using the --nomunge and --preserve-semi options but ...

How to execute "eval" without writing "eval" in JavaScript

Here's the deal, we have a big JS library that we want to compress, but YUI compressor doesn't fully compress the code if it finds an "eval" statement, out of fear that it will break something else. That's great and all, but we know exactly what is getting eval'd, so we don't want it to get conservative because there's an eval statement...

individually minify JS and CSS in Visual Studio 2010

I'm currently migrating a project to Visual Studio 2010 and am trying to figure out how to minify JS and CSS files individually on build. In Visual Studio 2008 I used a Web Deployment Projects with a build task that referenced the C# port of the YUI Compressor. In Visual Studio 2010 Web Deployment Projects seem to have been integrated ...

Does YUI compressor support bundling of multiple files?

I created a moduling system using jQuery. Is there any build system something similar to Dojo's Shrinksafe, that could combine all my module files into one single file for production? Does YUI Compresser is all about single file compression or does it support bundling the module files as well? JavascriptMVC uses a custom build of Shrin...

How to make the yuicompressor jar file a singleton, or globally accessible?

I'd like to put the yuicompressor jar file in a single folder so that I can call java -jar yuicompressor-2.4.2.jar ... from anywhere on my system, with cygwin. For bash files I use I simply put them in a common folder, and added the folder's path to my windows user's PATH environment variable and the bash commands were found in cygwin...

Get ant concat to ignore BOM's'?

I have an ant build that concatenates my javascript into one file and then compresses it. The problem is that Visual Studio's default encoding attaches a BOM to every file. How do I configure ant to strip out BOM's that would otherwise appear in the middle of the resulting concatenated file? My googl'ing revealed this discussion which i...

YUICompressor: wrong minification of jquery 1.4.2

Hi! When I am trying to compress jQuery with YUICompressor on UNIX machine, it adds some strange words which causes crash on jquery init: (function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)}get ,_jQuery=window.jQuery Note 'get ' before ,_jQuery=window.jQuery. There is no 'get ...

How to Minify .net AXD Resources

Hey I am working on a big .NET project. I am currently creating an automated minifier for JS and CSS files using YUI compressor. After doing some research, I found that the heaviest files in the project are actually .NET resources (Like MS ajax file). They are very big and unminified. I am wondering, is there any way to minify them? T...

Telling YUI compressor to remove specific non-commented code

In my javascript I have some bits of code specifically used for debugging which I don't want to include in the live site. Is there a way I can semi-comment these bits of code so that they run as javascript normally, but that yui compressor thinks they're comments and removes them? For example for(key in modules) { try { MyApp[k...

YUI Compressor + gzip causes Illegal Character error in jQuery

When I minify jquery using YUI compressor, it works fine. When I then add gzip compression (and serve this version via mod rewrite), the gzipped version throws this error: illegal character in jquery.min.js on line 1 Line 1 is: �������M�����������s�8�0�?�!sz�dKr�=� This results in a "jquery is not defined" error. I am using the follo...

yui-compressor works on one server, not on another?

I'm using YUI compressor jar file to merge and minify a number of JS and CSS files. This works great on my mac, and on my CentOS 5 server. Now I bought another CentOS VPS and the same script is not working on that pc. The minification gets done, but my minified javascript starts throwing errors. When compressing the same files with the...

Problem autoexecuting yuicompressor in Vim (executing it from any directory).

I made yuicompressor work from the command line. But the only thing I didn't understand from this tutorial is this part: You most install yuicompressor and make yuicompressor executable from any directory. How do I make it execute from any directory? ...

Can't execute YUIcompressor globally using Path enviroments (Windows XP)!

I typed D:\yuicompressor-2.42\build in Path and save it (Windows XP). But when I tried executing it the command line displayed: unable to access jarfile. The same message that appear when I type an incorrect directory. I tried executing the file in this way: D:\wamp\www\projects\alexchen\alexchen 0.1\scripts>java -jar yuicompressor-2.4...

HTML + JavaScript + CSS compact tool

I need a tool which can minify, optimize and munge many files of those possible types HTML (minify only) JavaScript (minify, optimize and munge) CSS (minify) The final result should be one HTML file only with all JavaScript and CSS embedded or in the worst scenario 3 files respectively for HTML, JS, and CSS. I am aware of tools like...

How to output a timestamp in MSBuild

I am using MSBuild/yuicompressor to combine and minify JavaScript. As part of this process, I want to modify my script references so they have a timestamp in the querystring. That way, a user always gets the non-cached version of the file when a new release is published. For example: <script type="text/javascript" src="/scripts/combine...

YUI compressor: Found an undeclared symbol

I have a collection of Javascript files that together constitute a system. Different parts of the system are in different (global) namespaces (e.g., NSA, NSB, etc.) and those namespaces may be objects, e.g. NSA = { ... lots of stuff ... } Now, in my various modules, I may have code such as: NSA.method(); My code JSLints cle...

YUI compressor added "get " string

Yuicompressor is adding a "get " string onto my javascript minified files ie: }get ,getExecuteProcessUrl:function(){var a=ERDAS.misc.getTilapiaBaseUrl()+"/executeW.do";return a}get ,cbRunStartSuccess:function(a,b){var c={interval:this.DEFAULT_INTERVAL};b.setStatus(a);b.cbSuccess(a); what is causing this? and how can I fix this? ...

YUI remove javascript comments

Hi, I need to remove comments (the "// This is a comment" like comments) from some Javascript code, I'm using YUI compressor, there is an option to do that? Thanks Thanks for the response, I'm trying to merge several scripts and after compress with YUI; I've found if I compress and then merge the scripts it works, but if I merge and ...