• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript gulp-insert.append函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中gulp-insert.append函数的典型用法代码示例。如果您正苦于以下问题:TypeScript append函数的具体用法?TypeScript append怎么用?TypeScript append使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了append函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:StevenLudwig,项目名称:universal,代码行数:34,代码来源:browser_code_generator.ts


示例2: 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


示例3:

 const tasks = [paths.coffee.bokehjs, paths.coffee.api, paths.coffee.widgets, paths.coffee.gl].map((entry) => {
   return gulp.src(entry.destination.fullWithPath)
     .pipe(rename((path) => path.basename += '.min'))
     .pipe(uglify({ output: {comments: /^!|copyright|license|\(c\)/i} }))
     .pipe(insert.append(license))
     .pipe(sourcemaps.write('./'))
     .pipe(gulp.dest(paths.buildDir.js))
 })
开发者ID:bgyarfas,项目名称:bokeh,代码行数:8,代码来源:scripts.ts


示例4:

gulp.task("scripts:minify", ["scripts:bundle"], () => {
  return gulp.src(`${paths.build_dir.js}/!(*.min|compiler).js`)
    .pipe(sourcemaps.init({loadMaps: true}))
    .pipe(rename((path) => path.basename += '.min'))
    .pipe(minify({ output: { comments: /^!|copyright|license|\(c\)/i } }))
    .pipe(insert.append(license))
    .pipe(sourcemaps.write("."))
    .pipe(gulp.dest(paths.build_dir.js))
})
开发者ID:Zyell,项目名称:bokeh,代码行数:9,代码来源:scripts.ts


示例5: 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



注:本文中的gulp-insert.append函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript gulp-insert.prepend函数代码示例发布时间:2022-05-25
下一篇:
TypeScript gulp-inline-ng2-template.default函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap