Downloads and custom builds
Latest download
Current version: 2.0.1:
Custom builds
It is recommended that you simply use the distribution-included minified files Only.min.js and Only-debug.min.js in production and development, respectively. However, you may want to use your own minification tool to "build" Only.min.js, from the source file (Only.src.js). This is fine, but make sure you don't use too aggressive of a minifier/compiler, as it's possible you could alter something about Only.js in an unexpected and breaking way. Typically, compressors like UglifyJS (without hoisting), YUIC, and Packer (without base62) are quite safe and should be fine.
Automatic builds
Only.js officially uses gulp for custom builds. Visit Gulp website to learn more.
To install gulp and other dependencies, open your terminal and type:
npm install
To rebuild source with gulp-uglify, open your terminal and type:
gulp dist
To lint the source file with gulp-jshint, open your terminal and type:
gulp lint
Hand-made builds
Also Only.js source code (Only.src.js) has DEBUG-mode code in it, delimited by /!*START_DEBUG*/ and /*!END_DEBUG*/ comments. This debug code is intended to be removed if minifying and building Only.min.js from the original source code (but left in if building Only-debug.min.js). This removal is possible with a simple preprocessing regex replace to remove the DEBUG-mode code from the source before minification. The following regular expression was used in automatic builds and should work for that purpose:
/\/*!START_DEBUG(?:.|\n)+END_DEBUG*\//
The Only-debug.min.js file skipped this step before minification, thus it includes the debug code. The Only.min.js file however has the DEBUG-mode code stripped from it.
NOTE: It should also be safe to simply pass Only.min.js or Only-debug.min.js to your own minifier (even though they are already minified), which will simply do a harmless re-minification of the file. The best option, however, would be to instruct your build process to ignore minification on these files.