callmecavs / layzr.js

A modern lazy loading library for images.

Home Page:http://callmecavs.com/layzr.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version number in min.js file

peterbe opened this issue · comments

I have no idea which version I installed last time. All I know is that bower found and downloaded version 1.2.2.

It would be awesome if the version number could be inserted as a comment on the first line of the dist/layzr.min.js.

Autocompeter does this using gulp-header.

going to do some surveying of other prominent JS libs (not to say that mine is prominent haha) and try to follow the industry best practice on this one.

if you have some examples of other libs that include a comment indicating version or otherwise in the minified file, i'd appreciate you linking them. thanks for the gulp plugin recommendation as well

Other libs other than autocompeter?
I don't think it matters. Where you get the version number from might vary but that gulpfile is a great example of how you're supposed to get it in there.

Oh, another thing you should consider is to NOT work on a file in the dist/ directory. That directory is usually meant for computer generated things.

In Autocompeter I work on the files in src/ and my gulpfile.js creates the files in dist/.

what i was asking was: do major js libraries include version numbers in their minified versions? i'd like to follow their lead - based on what i'm seeing, it looks like they do, and so i've added this to the roadmap.

completely see your point about the src folder. an added benefit would be using something like gulp-umd to add the UMD wrapper, to keep that ugliness out of the source file.

both changes coming later today, thanks dude!

Examples:

Yeah, I didn't know about gulp-umd but that's a really good point!

yep, seems to be standard. thanks man, will update you when i make some changes later today

@peterbe fixed the repo folder structure (added the src folder, dist folder is only processed output) in the new release, v1.3.0. part of this fix was adding a comment to the top of both dist files that includes version number. thanks again for the help bud, gulp-header proved the best way to go about it