2017-04-27 15:25:00 +02:00
|
|
|
var fs = require('fs')
|
|
|
|
var path = require('path')
|
2018-07-03 00:49:33 +02:00
|
|
|
var browserify = require('browserify')
|
2017-04-27 15:25:00 +02:00
|
|
|
var tests = fs.readdirSync(path.join(__dirname, 'lib'))
|
|
|
|
var bundlePath = path.join(__dirname, 'test-bundle.js')
|
2018-07-03 00:49:33 +02:00
|
|
|
var b = browserify()
|
2017-04-27 15:25:00 +02:00
|
|
|
|
|
|
|
// Remove old bundle
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(bundlePath)
|
2017-04-28 21:19:14 +02:00
|
|
|
} catch (e) {
|
|
|
|
console.error(e)
|
|
|
|
}
|
2017-04-27 15:25:00 +02:00
|
|
|
|
|
|
|
var writeStream = fs.createWriteStream(bundlePath)
|
|
|
|
|
2018-07-03 00:49:33 +02:00
|
|
|
tests.forEach(function (fileName) {
|
2017-04-27 15:25:00 +02:00
|
|
|
b.add(path.join(__dirname, 'lib', fileName))
|
|
|
|
})
|
|
|
|
|
2018-07-03 00:49:33 +02:00
|
|
|
b.bundle().pipe(writeStream)
|
2017-04-27 15:25:00 +02:00
|
|
|
|