/**
 * Minify javascript files.
 * @function task.worker.minifyJsFiles
 * @param {object} config - Work configuration.
 * @param {string} config.srcDir - Source js directory.
 * @param {string} config.ignore - Ignore  js pattern. Glob.
 * @param {string} config.pattern - Source js file pattern. Glob.
 * @param {string} config.destDir - Destination html directory.
 * @param {function} callback - Callback when done.
 * @author Taka Okunishi
 *
 */
var debug = require('./_debug'),
    _convertDirectory = require('./_convert_directory'),
    lib = require('../../lib'),
    minify = lib.minify,
    minifyJsFile = minify.minifyJsFile;

var _minifyFiles = require('./_minify_files');

exports = module.exports = function (config, callback) {
    _minifyFiles(config, [/\.js$/, '.min.js'], minifyJsFile, callback);
};