2016-10-13 05:03:14 +02:00
|
|
|
var fs = require('fs')
|
|
|
|
var path = require('path')
|
2017-05-04 23:35:10 +02:00
|
|
|
var browserify = require('browserify')
|
2016-10-13 05:03:14 +02:00
|
|
|
var tests = fs.readdirSync(path.join(__dirname, 'lib'))
|
|
|
|
var bundlePath = path.join(__dirname, 'bundle.js')
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
var b = browserify()
|
2016-10-13 05:03:14 +02:00
|
|
|
|
|
|
|
// Remove old bundle
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(bundlePath)
|
|
|
|
|
2017-06-22 15:46:03 +02:00
|
|
|
var writeStream = fs.createWriteStream(bundlePath)
|
2016-10-13 05:03:14 +02:00
|
|
|
|
2017-06-22 15:46:03 +02:00
|
|
|
tests.forEach(function (fileName) {
|
|
|
|
b.add(path.join(__dirname, 'lib', fileName))
|
|
|
|
})
|
2016-10-13 05:03:14 +02:00
|
|
|
|
2017-06-22 15:46:03 +02:00
|
|
|
b.bundle().pipe(writeStream)
|
|
|
|
} catch (e) {
|
|
|
|
console.error('Integration build failure', e)
|
|
|
|
}
|
2016-10-13 05:03:14 +02:00
|
|
|
|