Skip to content

Commit 70b42ce

Browse files
committed
Fix Browserify transforms being applied in wrong order
Also fixes minification not working for CoffeeScript in some use cases
1 parent 332a856 commit 70b42ce

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
<a name="1.5.1"></a>
2+
# 1.5.1 Luděk's Phở (2014-08-26)
3+
4+
- Fix Browserify transforms being applied in wrong order
5+
- Fix minification not working for CoffeeScript in some use cases
6+
17
<a name="1.5.0"></a>
2-
# 1.5.0 Cyril's Phở (2014-08-25)
8+
# 1.5.0 Radim's Phở (2014-08-25)
39

410
- Better error reporting for Browserify
511

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ module.exports = function(gulp, userConfig) {
9595
var bundler = browserify(config.browserify);
9696

9797
// apply browserify transforms from config
98-
for (var transform in config.browserify.transforms) {
99-
if (config.browserify.transforms.hasOwnProperty(transform) && config.browserify.transforms[transform]) {
98+
// hack with Array.prototype.reverse() is used, because V8 iterates over objects in reversed order
99+
// https://code.google.com/p/v8/issues/detail?id=164
100+
Object.keys(config.browserify.transforms).reverse().forEach(function (transform) {
101+
if (config.browserify.transforms[transform])
100102
bundler.transform(transform);
101-
}
102-
}
103+
});
103104

104105
var scriptsDependencies = [];
105106
if (isPluginEnabled('jshint'))

0 commit comments

Comments
 (0)