Xaver
Xaver

Reputation: 11682

Should I include compressed files in subversion system?

I compress all my JavaScript files and CSS files with YUI Compressor

yuicompressor -o '.js$:.min.js' *.js -v

Should I keep the minified files in my subversion system or not?

I know both is possible but I'm searching for "best practice" and the pros and cons

Upvotes: 1

Views: 97

Answers (5)

potatopeelings
potatopeelings

Reputation: 41065

Minified versions should not be in source system if you are able to generate them from the actual files in a controlled manner. This would imply that you have a build system and tools in place that is also controlled. For e.g. let's say that someone changes your YUI compressor version tomorrow. If you don't have the old version somewhere your build could break.

With the same logic, it would make sense to keep both the minified and unminified versions of any 3rd party libraries.

Upvotes: 0

ben
ben

Reputation: 3568

SVN (or got or any versioning system) is there for keeping track of the code, not of the releases thus (IMO) it does not make sense to keep a version of the releases. It is better to let a dedicated tool handling that (like artifactory)

Upvotes: 0

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167192

OKay, this answer will purely depend on your project. Say if your project engine is capable of producing minified files, then you may not need to do this.

But say, if this is the same exact code that has to be deployed in your webserver, and all your HTML files depend on the minified code, then you have to add this.

In a nutshell, in doubt, keep the file!

Upvotes: 0

CheckeredMichael
CheckeredMichael

Reputation: 571

I think it would be best to leave out any minified files.

The reason for this is, if you have a junior come in to work on your site and they see the minified files, but not the other files, they might end up formatting your minified file so it's more readable, make changes and then when you go back to edit the correct file and compress, all his work has gone.

Worst case scenario when you don't include them is the junior will ask why his changes haven't displayed on the site and you can explain to him the correct tools which you are currently using.

Upvotes: 2

Per Östlund
Per Östlund

Reputation: 1224

My opinion is that it is a better to have that as part of the building process. And builds should not be in the version tracking system for the source code. For that reason, minified javascript files shouldn't be there either.

Upvotes: 2

Related Questions