本文整理汇总了TypeScript中vinyl-buffer.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getBrowserCodeStream
export function getBrowserCodeStream(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(' + stringifyWithFunctions(opts) + ');\n\n'))
.pipe(rename('preboot.js'));
// uglify if the option is passed in
return opts.uglify ? outputStream.pipe(uglify()) : outputStream;
}
开发者ID:TheLarkInn,项目名称:universal,代码行数:33,代码来源:browser_code_generator.ts
示例2: rebundleRelease
function rebundleRelease(bundleStream) {
return bundleStream.bundle()
.pipe(source('main.js'))
.pipe(streamify(uglify(smildSettings.uglifyjs)))
.pipe(buffer())
.pipe(gulp.dest(helper.getTempFolder() + '/js'));
}
开发者ID:mtfranchetto,项目名称:smild,代码行数:7,代码来源:Browserify.ts
示例3: return
return (next: (arg?: any) => void) => {
if (argv.verbose) gutil.log(`Building ${plugin_name}`)
const pluginOpts = {
entries: [path.resolve(path.join(paths.buildDir.jsTree, main))],
extensions: [".js"],
debug: true,
preludePath: pluginPreludePath,
prelude: pluginPreludeText,
paths: ['./node_modules', paths.buildDir.jsTree],
}
const plugin = browserify(pluginOpts)
labels[plugin_name] = namedLabeler(plugin, labels.bokehjs)
for (const file in labels.bokehjs) {
const name = labels.bokehjs[file]
if (name !== "_process")
plugin.external(file)
}
plugin
.bundle()
.pipe(source((paths.coffee as any)[plugin_name].destination.full))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
// This solves a conflict when requirejs is loaded on the page. Backbone
// looks for `define` before looking for `module.exports`, which eats up
// our backbone.
.pipe(change((content: string) => {
return `(function() { var define = undefined; return ${content} })()`
}))
.pipe(insert.append(license))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.buildDir.js))
.on('end', () => next())
}
开发者ID:bgyarfas,项目名称:bokeh,代码行数:33,代码来源:scripts.ts
示例4: build
build(){
const stream = this.bundler
.plugin(tsify, {})
// .transform('brfs', {})
.bundle();
const sourceMapLocation = $.prod ? './' : '';
return stream.on('error', function (err:any) {
$.plugin.util.log(err.toString());
this.emit('end');
})
.pipe(source(this.path))
.pipe($.plugin.if(this.sourcemap, buffer()) )
.pipe($.plugin.if(this.sourcemap, $.plugin.sourcemaps.init({ loadMaps: true })) )
.pipe($.plugin.if($.prod, $.plugin.streamify($.plugin.uglify({
compress: { drop_console: true }
}))))
.pipe($.plugin.if(this.sourcemap, $.plugin.sourcemaps.write(sourceMapLocation)) )
.pipe($.plugin.rename({dirname: ''}) )
.pipe($.plugin.if($.prod, $.cachebust.resources()))
.pipe($.plugin.rename(function (path:any) {
path.extname = '.js'
}))
.pipe($.gulp.dest($.config.scripts.dest)).on('end',
function() {
$.bs.reload;
});
}
开发者ID:AlexKryzh,项目名称:angular-typescript-seed,代码行数:29,代码来源:scripts.ts
示例5: browserify
const tasks = files.map((entry: string) => {
return browserify({ entries: [entry] })
.bundle()
.pipe(source(entry.replace('tmp', 'resources')))
.pipe(buffer())
.pipe(uglify())
.pipe(dest('./built'));
});
开发者ID:armchair-philosophy,项目名称:Misskey-Web,代码行数:8,代码来源:gulpfile.ts
示例6: function
gulp.task(`bundle${id}`, ['build'], function() {
// set up the browserify instance on a task basis
var b = browserify({
entries: [file],
debug: true,
paths: ['scripts'],
});
return b.bundle()
.pipe(source(outfile))
.pipe(buffer())
.pipe(gulp.dest(''));
});
开发者ID:cmc19,项目名称:GutiarLibTS,代码行数:14,代码来源:gulpfile.ts
示例7: through
files.forEach(filepath => {
console.log(filepath);
var bundledStream = through();
var fileParts = filepath.split('/');
var directory = fileParts.slice(0, fileParts.length - 1).join('/');
var filename = fileParts[fileParts.length - 1].replace('.ts', '.out.js');
if (filename == 'app.js')
return;
if (filename.indexOf('.out.out.') !== -1) {
return;
}
console.log(`dir: ${directory} filename: ${filename}`);
bundledStream
.pipe(source(filename))
.pipe(buffer())
// .pipe(sm.init({loadMaps: true}))
// .pipe(uglify())
// .pipe(sm.write('./'))
.pipe(gulp.dest(directory));
globby(taskPath, function(err, entries) {
if (err) {
bundledStream.emit('error', err);
return;
}
var b = browserify({
entries: [filepath],
debug: true,
paths: ['scripts'],
noParse:['lodash.js'],
standalone: 'GLib'
}).plugin('tsify',{target:'es5'});
b.bundle().pipe(bundledStream);
});
});
开发者ID:cmc19,项目名称:GutiarLibTS,代码行数:41,代码来源:gulpfile.ts
示例8: buildBokehjs
function buildBokehjs(next: (arg?: any) => void) {
if (argv.verbose) gutil.log("Building bokehjs")
bokehjs.exclude(path.resolve("build/js/tree/models/glyphs/webgl/index.js"))
labels.bokehjs = namedLabeler(bokehjs, {})
bokehjs
.bundle()
.pipe(source(paths.coffee.bokehjs.destination.full))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
// This solves a conflict when requirejs is loaded on the page. Backbone
// looks for `define` before looking for `module.exports`, which eats up
// our backbone.
.pipe(change((content: string) => {
return `(function() { var define = undefined; return ${content} })()`
}))
.pipe(change((content: string) => {
return `window.Bokeh = Bokeh = ${content}`
}))
.pipe(insert.append(license))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.buildDir.js))
.on('end', () => next())
}
开发者ID:bgyarfas,项目名称:bokeh,代码行数:23,代码来源:scripts.ts
示例9: bundle
function bundle(namespace: string) {
let bundler = browserify(
SOURCE_DIR + '/' + namespace + '/app/app-' + env + '.js',
{
debug: true
}
).transform(babelify, { presets: ['es2015'] });
return bundler.bundle()
.on('error', function (err) {
console.log(err);
this.emit('end');
})
.pipe(source('app.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(gulpif(minify, uglify()))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(DEST_DIR + '/' + namespace));
}
开发者ID:lindsaymacvean,项目名称:seventag,代码行数:24,代码来源:Gulpfile.ts
注:本文中的vinyl-buffer.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论