本文整理汇总了TypeScript中vinyl-source-stream类的典型用法代码示例。如果您正苦于以下问题:TypeScript vinyl-source-stream类的具体用法?TypeScript vinyl-source-stream怎么用?TypeScript vinyl-source-stream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vinyl-source-stream类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getBrowserCodeStream
export function getBrowserCodeStream(appName: string, opts?: PrebootOptions): any {
opts = normalize(opts);
let bOpts = {
entries: [__dirname + '/../browser/preboot_browser.js'],
standalone: 'preboot',
basedir: __dirname + '/../browser',
browserField: false
};
let b = browserify(bOpts);
// ignore any strategies that are not being used
ignoreUnusedStrategies(b, bOpts, opts.listen, listenStrategies, './listen/listen_by_');
ignoreUnusedStrategies(b, bOpts, opts.replay, replayStrategies, './replay/replay_after_');
if (opts.freeze) {
ignoreUnusedStrategies(b, bOpts, [opts.freeze], freezeStrategies, './freeze/freeze_with_');
}
// ignore other code not being used
if (!opts.buffer) { b.ignore('./buffer_manager.js', bOpts); }
if (!opts.debug) { b.ignore('./log.js', bOpts); }
// use gulp to get the stream with the custom preboot browser code
let outputStream = b.bundle()
.pipe(source('src/browser/preboot_browser.js'))
.pipe(buffer())
.pipe(insert.append('\n\n;preboot.init("' + appName + '",' + stringifyWithFunctions(opts) + ');\n\n'))
.pipe(insert.append('\n\n;preboot.init("' + appName + '2",' + stringifyWithFunctions(opts) + ');\n\n'))
.pipe(rename('preboot.js'));
// uglify if the option is passed in
return opts.uglify ? outputStream.pipe(uglify()) : outputStream;
}
示例2: rebundle
function rebundle() {
return bundler
.bundle()
.on('error', function(er:any)
{
console.log(er.message);
this.emit('end');
})
.pipe(source(dest))
.pipe(gulp.dest(paths.dest));
}
示例3: browserify
const tasks = files.map((entry: string) => {
return browserify({ entries: [entry] })
.bundle()
.pipe(source(entry.replace('tmp', 'resources')))
.pipe(gulp.dest('./built'));
});