We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd5a3bc commit f4a2862Copy full SHA for f4a2862
Gruntfile.js
@@ -24,15 +24,10 @@ module.exports = function(grunt) {
24
// custom browserify transformer to re-write plugins to
25
// self-register with Raven via addPlugin
26
function AddPluginBrowserifyTransformer() {
27
+ var noop = function (chunk, _, cb) { cb(null, chunk); };
28
+ var append = function (cb) { cb(null, "\nrequire('../src/singleton').addPlugin(module.exports);"); };
29
return function(file) {
- return through(function(buf, enc, next) {
- buf = buf.toString('utf8');
30
- if (/plugins/.test(file)) {
31
- buf += "\nrequire('../src/singleton').addPlugin(module.exports);";
32
- }
33
- this.push(buf);
34
- next();
35
- });
+ return through(noop, /plugins/.test(file) ? append : undefined);
36
};
37
}
38
0 commit comments