'use strict';
-const _ = require('lodash');
-const fs = require('fs-extra');
-const glob = require('glob');
-const path = require('path');
+var _ = require('lodash'),
+ fs = require('fs-extra'),
+ glob = require('glob'),
+ path = require('path');
-const minify = require('../common/minify.js');
+var minify = require('../common/minify.js');
/*----------------------------------------------------------------------------*/
}
/**
- * Creates an object of base name and compiled template pairs that match `pattern`.
+ * Creates an object of compiled template and base name pairs that match `pattern`.
*
* @memberOf file
* @param {string} pattern The glob pattern to be match.
* @returns {Object} Returns the object of compiled templates.
*/
function globTemplate(pattern) {
- return _.transform(glob.sync(pattern), (result, filePath) => {
- const key = path.basename(filePath, path.extname(filePath));
+ return _.transform(glob.sync(pattern), function(result, filePath) {
+ var key = path.basename(filePath, path.extname(filePath));
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
}, {});
}
/*----------------------------------------------------------------------------*/
module.exports = {
- copy,
- globTemplate,
- min,
- write
+ 'copy': copy,
+ 'globTemplate': globTemplate,
+ 'min': min,
+ 'write': write
};