Re: Controlling compressors
- I have found the following code works in both my Pretty Diff application and the JSLint tool:
/*prettydiff.com api.topcoms: true*/
var a; //arbitrary code here
/*throw away comment here*/
I would have thought JSLint would throw an error for multiple uses of the "var" keyword in any single scope, but apparently not in the global scope.
--- In email@example.com, Tom Worster <fsb@...> wrote:
> Some compressors do not touch the initial comments of a file in order to
> leave copyright, license etc. in place. I find that useful. However, some
> of my files have comments after the public notices but before the first
> lines of actual script that I would prefer to not see in the compressed
> file. I can do that by separating these two passages of comments with a
> bit of JS code.
> But I haven't come up with a separator that has no other purpose or effect
> that both I and JSLint like.
> What's a JSLint-friendly bit of trivial code for this purpose?
- On 8/8/12 10:11 AM, "Jakob Kruse" <kruse@...> wrote:
>This is very compressor specific, is it not?i don't know.
>Both comments would be removed (regardless of your choice of snippet) byone redundant ; does not amount filling a source file with garbage code.
>JSMin and YUI Compressor for instance, but with YUI Compressor you can
>prevent the removal of any comment by starting it with "/*!". This seems
>like a much better idea than filling your source files with garbage code,
tolerating it and the resulting JSList warning remains an option.