0

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 ' in source code of course.

When compressing on windows machine all things are ok.

Any clues?

Kevin Hakanson
  • 38,937
  • 23
  • 119
  • 148
glaz666
  • 8,415
  • 17
  • 53
  • 73
  • 1
    The same tool in different environments produces different results - it's probably a bug. – nc3b May 06 '10 at 08:38
  • What version of YUI Compressor? 2.4.2 seems to the be latest release. Also, are you passing any command line options run you run it? Do you have the same version of Java on your unix machine? – Kevin Hakanson Aug 08 '10 at 22:56

1 Answers1

0

On day 1 of the "14 days of jQuery," it is mentioned you can download jQuery already minified:

As usual, we provide two copies of jQuery, one minified (we now use the Google Closure Compiler as the default minifier) and one uncompressed (for debugging or reading).

Also, check out jQuery compiled with Google Closure Compiler.

Community
  • 1
  • 1
Kevin Hakanson
  • 38,937
  • 23
  • 119
  • 148
  • yeah, nice! but I have asked about compression problem of YUICompressor. When developing production code, you need uncompressed JS for dev environment and compressed JS for prod environment. And that is pretty nasty to make special exceptions for already compressed files. – glaz666 Aug 08 '10 at 18:26
  • The standard is to conditionally include either the full version or the minified version based on the environment. So, both versions are in your source, but depending on your environment one or the other is linked to. Depending on your technology, framework, or build process, you can alternately rename/overwrite the non-minified version with the pre-minified version at post-build/deploy time. – Jon Adams Jan 20 '11 at 23:53