From fd365c27e2e59689f106a82919346117237e1e72 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 10 Apr 2016 22:36:45 -0700 Subject: [PATCH] Add doc comments to the minify file util. [ci skip] --- lib/common/minify.js | 13 +++++++++++++ lib/common/uglify.options.js | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/lib/common/minify.js b/lib/common/minify.js index f1abfb081..7a0082d3e 100644 --- a/lib/common/minify.js +++ b/lib/common/minify.js @@ -8,6 +8,19 @@ var uglifyOptions = require('./uglify.options'); /*----------------------------------------------------------------------------*/ +/** + * Asynchronously minifies the file at `srcPath`, writes it to `destPath`, and + * invokes `callback` upon completion. The callback is invoked with one argument: + * (error). + * + * If unspecified, `destPath` is `srcPath` with an extension of `.min.js`. For + * example, a `srcPath` of `path/to/foo.js` would have a `destPath` of `path/to/foo.min.js`. + * + * @param {string} srcPath The path of the file to minify. + * @param {string} [destPath] The path to write the file to. + * @param {Function} callback The function invoked upon completion. + * @param {Object} [option] The UglifyJS options object. + */ function minify(srcPath, destPath, callback, options) { if (_.isFunction(destPath)) { if (_.isObject(callback)) { diff --git a/lib/common/uglify.options.js b/lib/common/uglify.options.js index a528c5f5f..1c52f61e2 100644 --- a/lib/common/uglify.options.js +++ b/lib/common/uglify.options.js @@ -1,5 +1,11 @@ 'use strict'; +/** + * The UglifyJS options object for + * [compress](https://github.com/mishoo/UglifyJS2#compressor-options), + * [mangle](https://github.com/mishoo/UglifyJS2#mangler-options), and + * [output](https://github.com/mishoo/UglifyJS2#beautifier-options) options. + */ module.exports = { 'compress': { 'pure_getters': true,