This tool prepends a piece of text to the result of a browserify bundle. it is useful for making userscripts with browserify because the header information is a piece of text at the top of the script.
const browserify = require('browserify');
const apply_header = require('./prepend_text.js');
function bundle (header_string) {
return browserify()
.add(path.join('source', 'entry.js'))
.plugin(apply_header, header_string)
.bundle();
}
All code in this repository is licensed under the Unlicense and is in the Public Domain.