Merge script files by document.write use gulp.
- Support javascript comment.
- Support nested document.write. Process recursively.
see example gulpfile
var gulp = require('gulp'),
documentWrite = require('gulp-document-write');
gulp.task('default', function() {
gulp.src('./web/**/*.js')
.pipe(documentWrite({
context: './web', // Specify webroot if document.write absolute path. Default: process.cwd()
relativeTo: './web' // Specify relative to which path. Default: the file.path
}))
.pipe(gulp.dest('./build'));
});