Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minified versions cannot be consolidated to a single js file #46

Closed
SkyPHP opened this issue Apr 7, 2011 · 5 comments
Closed

minified versions cannot be consolidated to a single js file #46

SkyPHP opened this issue Apr 7, 2011 · 5 comments

Comments

@SkyPHP
Copy link

SkyPHP commented Apr 7, 2011

The compressed versions are weird. I used this minifier below and now I no longer get javascript errors when combining the various history.js files into a single history-all.js file.

http://refresh-sf.com/yui/

@balupton
Copy link
Member

balupton commented Apr 8, 2011

Hey mate,

Could you specify some more about the problem that's occurring and which files you're trying to bundle and what the error is.

Thanks :)

@SkyPHP
Copy link
Author

SkyPHP commented Apr 8, 2011

I'm using version 1.5.
(1.7 is not working for me, however there are no javascript errors. I haven't had time to dig deeper into this yet so I'm still using 1.5)

When I bundle the compressed versions of history.js and history.html4.js I get this error:
In Chrome: undefined is not a function
In Firefox: (function(a,b){...})(window) is not a function

Bundling the uncompressed versions are fine.

I tried different combinations of bundles using history.js, history.html4.js, and history.adapter.jquery.js to see if I could narrow down which file was the problem, but every bundle I try results in error.

I minified each of these 3 files using the above link and then bundled them into a single file and it works.

@deleteme
Copy link
Contributor

deleteme commented Apr 8, 2011

You gotta ensure that there is a semi-colon at the end of each file.

Otherwise, the two closures sit next to each other.

@SkyPHP
Copy link
Author

SkyPHP commented Apr 8, 2011

oops, i should have seen that. thanks!

@SkyPHP SkyPHP closed this as completed Apr 8, 2011
@deleteme
Copy link
Contributor

deleteme commented Apr 8, 2011

Yeah. I have noticed that many minifiers, including Uglify, removes the trailing semi-colon at the end of a file. Google Closure keeps it intact.

This removal is fine if the file is not being concatenated with other scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants