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)
|
|
|
|
} catch (e) {}
|
|
|
|
|
|
|
|
var writeStream = fs.createWriteStream(bundlePath)
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
tests.forEach(function (fileName) {
|
2016-10-13 05:03:14 +02:00
|
|
|
b.add(path.join(__dirname, 'lib', fileName))
|
|
|
|
})
|
|
|
|
|
2017-05-04 23:35:10 +02:00
|
|
|
b.bundle().pipe(writeStream)
|
2016-10-13 05:03:14 +02:00
|
|
|
|