gulp-browserify-watchify-glob
Create a Browserify bundler with multiple entries based on a glob pattern. Rebuild incrementally watching for changes, including additions and deletions of files that match the glob pattern.
Quickstart
npm i gulp-browserify-watchify-glob -D
yarn add gulp-browserify-watchify-glob --dev
import globbedBrowserify from 'gulp-browserify-watchify-glob';
const globbedBrowserify = require('gulp-browserify-watchify-glob');
const unittestBundler = globbedBrowserify({
entries: 'src/**/*-test.js',
debug: true,
}).transform();
export function runTests() {
return unittestBundler.bundle().pipe();
}
export function watch() {
const startWatchingTests = unittestBundler.watch(runTests);
startWatchingTests();
unittestBundler.watch(runTests)();
const wrapsKickoff = unittestBundler.watch(runTests, kickoff);
wrapsKickoff();
}
Caveats
- This is prerelease software. It was extracted from a gulpfile and has been field-tested, but there are no unittests yet.
- Browserify was not designed with this use case in mind. I rely on browserify implementation details in order to make the magic work.