Skip to content

Commit

Permalink
Merge branch 'release/0.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
budnix committed Jun 30, 2016
2 parents 790af33 + dc57500 commit a8233ae
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions lib/utils/array-unique.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Unique array values.
*
* @param {Array} array
* @return {Array}
*/
module.exports = function arrayUnique(array) {
return array.filter(function(item, i, arr) {
return arr.indexOf(item) === i;
});
};
15 changes: 8 additions & 7 deletions lib/workers/js-worker.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var arrayUnique = require('./../utils/array-unique');
var BaseWorker = require('./_base-worker');
var browserify = require('browserify');
var browserifyDerequire = require('browserify-derequire');
var detachkify = require('./../transformers/detachkify');
var es6ify = require('./../transformers/es6ify');
var EntryFile = require('./../entry-file');
var es6ify = require('./../transformers/es6ify');
var fs = require('fs');
var inherits = require('inherits');
var labelMinifier = require('./../plugin/label-minifier');
Expand Down Expand Up @@ -57,7 +58,7 @@ JSWorker.prototype.run = function(entryFile, callback) {
});

var uniqModules = [];
var internalModules = [];
var modules = [];
var ignoredModules = [];

this.dependencyTree.forEach(function(module) {
Expand All @@ -66,10 +67,9 @@ JSWorker.prototype.run = function(entryFile, callback) {
});

if (module.isExternal() || module.isInternal()) {
if (module.isInternal()) {
// Make flat array of internal modules
internalModules.push.apply(internalModules, module.getJSFiles());
}
// Make flat array
modules.push.apply(modules, module.getJSFiles());

if (uniqModules.indexOf(module.name) === -1) {
uniqModules.push(module.name);

Expand All @@ -83,12 +83,13 @@ JSWorker.prototype.run = function(entryFile, callback) {
}
}
} else {
// The appropriate source code
_this.b.add(module.getJSFiles());
}
});

this.b.transform(es6ify({
ignore: internalModules
ignore: arrayUnique(modules)
}));
this.b.transform(detachkify, {
prefix: 'handsontable',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/handsontable/hot-builder.git"
},
"author": "Handsoncode <[email protected]>",
"version": "0.5.2",
"version": "0.5.3",
"main": "./lib/builder.js",
"bin": "./bin/hot-builder",
"scripts": {
Expand Down

0 comments on commit a8233ae

Please sign in to comment.