1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 11:20:19 +00:00
musix-oss/node_modules/when/scripts/browserify-tests.js

24 lines
612 B
JavaScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
var path = require('path');
var fs = require('fs');
var glob = require('glob');
var browserify = require('browserify');
var POSIX_SEP = path.posix ? path.posix.sep : '/';
var ROOT_DIR = path.resolve(__dirname, '..');
var outputFile = path.resolve(ROOT_DIR, 'test', 'browser', 'tests.js');
var entries = glob(path.join(ROOT_DIR, 'test', '**', '*-test.js'), { sync: true });
if (path.sep !== POSIX_SEP) {
entries = entries.map(function (entry) {
return entry.split(POSIX_SEP).join(path.sep);
});
}
browserify({
entries: entries
})
.external('buster')
.bundle()
.pipe(fs.createWriteStream(outputFile));