This commit is contained in:
zino
2021-03-02 00:06:38 +01:00
parent 3a8aab0e9a
commit eeb745b013
3567 changed files with 1234741 additions and 0 deletions

28
client/node_modules/browserify/test/tr.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;
var through = require('through2');
test('function transform', function (t) {
t.plan(7);
var b = browserify(__dirname + '/tr/main.js');
b.transform({ global: true }, function (file) {
return through(function (buf, enc, next) {
this.push(String(buf).replace(/ZZZ/g, '1'));
next();
});
});
b.transform(function (file) {
return through(function (buf, enc, next) {
this.push(String(buf)
.replace(/AAA/g, '5')
.replace(/BBB/g, '50')
);
next();
})
});
b.bundle(function (err, src) {
vm.runInNewContext(src, { t: t });
});
});