Skip to content

Commit

Permalink
build: Fix browserify plugin transform append (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored and kamilogorek committed Feb 14, 2018
1 parent dd5a3bc commit f4a2862
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ module.exports = function(grunt) {
// custom browserify transformer to re-write plugins to
// self-register with Raven via addPlugin
function AddPluginBrowserifyTransformer() {
var noop = function (chunk, _, cb) { cb(null, chunk); };
var append = function (cb) { cb(null, "\nrequire('../src/singleton').addPlugin(module.exports);"); };
return function(file) {
return through(function(buf, enc, next) {
buf = buf.toString('utf8');
if (/plugins/.test(file)) {
buf += "\nrequire('../src/singleton').addPlugin(module.exports);";
}
this.push(buf);
next();
});
return through(noop, /plugins/.test(file) ? append : undefined);
};
}

Expand Down

0 comments on commit f4a2862

Please sign in to comment.