Skip to content

Commit

Permalink
Adding index.js to load es5 or es6 depending on the test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Apr 29, 2017
1 parent 2edf1a3 commit 0e07bba
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ module.exports = function(grunt) {
banner = "/*\n " + new Date().getFullYear() + " " + pkg.author + "\n @version " + pkg.version + "\n*/\n\"use strict\";";

fs.writeFileSync(path.join(__dirname, "lib", "filesize.es6.min.js"), banner + minified.code + "\n//# sourceMappingURL=filesize.es6.min.js.map", "utf8");
grunt.log.ok("Created minified es6 file");
grunt.log.ok("1 file created.");
fs.writeFileSync(path.join(__dirname, "lib", "filesize.es6.min.js.map"), JSON.stringify(minified.map), "utf8");
grunt.log.ok("Created minified es6 source map");
grunt.log.ok("1 sourcemap created.");
});

// aliases
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require(require("path").join(__dirname, "lib", Number(process.version.replace("v", "").split(".")[0]) >= 6 ? "filesize.es6" : "filesize"));
2 changes: 1 addition & 1 deletion lib/filesize.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 3.5.7
* @version 3.5.8
*/
(function (global) {
const b = /^(b|B)$/,
Expand Down
2 changes: 1 addition & 1 deletion lib/filesize.es6.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/filesize.es6.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/filesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 3.5.7
* @version 3.5.8
*/
(function (global) {
var b = /^(b|B)$/,
Expand Down
2 changes: 1 addition & 1 deletion lib/filesize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e07bba

Please sign in to comment.