Should a sites development be completed prior to setting the compression for site and jquery? If so then what would happen if you then need to do maintenance of the site further down the track.
1 Answer
- You should maintain the uncompressed version for development.
- Use any tool to compress the javascript files automatically.
- if Joomla debug mode is true, include un-compressed files, else include compressed files.
Tip
Checking debug mode in joomla.
echo JDEBUG ? 'debug mode is on' : 'debug mode is off' ;
-
-
1Yes, as it is checked in index.php file. github.com/joomla/joomla-cms/blob/staging/index.php#L34– ShyamApr 23, 2014 at 10:31
-
Ok, that would seem to suggest that it is safe to assume that it is. In fact, it appears to be defined in
/includes/framework.php
which is included earlier inindex.php
. (My initial concern was that ifJDEBUG
is not defined then the above statement will evaluate totrue
, which is probably not correct. I encountered this sort of thing whilst debugging WordPress a while ago; hence my concern.)– MrWhiteApr 23, 2014 at 11:41