當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript gulp.watch函數代碼示例

本文整理匯總了TypeScript中gulp.watch函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript watch函數的具體用法?TypeScript watch怎麽用?TypeScript watch使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了watch函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: jade

    gulp.task(name, [Build.name], () => {
        const ts = [
            root.application.scripts.typescripts().toString(),
            root.application.scripts.typings().Not(),
//            `${Folders.clientUnitTests}/**/*.ts`,
//            `!${Folders.clientUnitTests}/typings/**/*`,
//            `!${Folders.clientUnitTests}/node_modules/**/*`,
//            `${Folders.gulp}/**/*.ts`,
//            `!${Folders.gulp}/typings/**/*.ts`,
//            `!${Folders.gulp}/node_modules/**/*`
        ];

        const jade = [
            root.application.jade().toString()
        ];

        gulp.watch(jade, jadeLint);
        gulp.watch(ts, tslint);
//        gulp.watch(ts, purge);
        gulp.watch(root.application.styles.files().toString(), [Css.name]);

//        const environmentFiles = [
//            root.application.environment.template().toString(),
//            root.packageJson().toString()
//        ];
//        gulp.watch(environmentFiles, [Environment.name]);
        gulp.watch(root.application. jade().toString(), [Jade.name]);
//        gulp.watch(root.application.jade().toString(), purge);
    });
開發者ID:ibzakharov,項目名稱:angular_project_template,代碼行數:29,代碼來源:gulpfile.ts

示例2: function

gulp.task('autoTest', ['build-dev', 'templatecache', 'compile-specs'], function(done: () => any) {
    gulp.watch([config.sourceTs], ['build-dev'])
            .on('change', changeEvent);
     gulp.watch([config.sourceSpecs], ['compile-specs'])
            .on('change', changeEvent);
    startTests(false, done);
});
開發者ID:dcaballeroc,項目名稱:unicron,代碼行數:7,代碼來源:gulpfileTypescript.ts

示例3: function

gulp.task('browserSync', function () {
    browserSync.init({
        port: 8000,
        proxy: "http://localhost:12345"
    });

	function debounce(fn, delay) {
	  var timer = null;
	  return function () {
		var context = this, args = arguments;
		clearTimeout(timer);
		timer = setTimeout(function () {
		  fn.apply(context, args);
		}, delay);
	  };
	}

    gulp.watch(["src/**/*.ts"], ['compile', 'reloadBrowserSync']).on('change', function (e) {
        console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
    });
    gulp.watch(["src/*js", "src/**/*.html", "src/**/*.css"], ['resources', 'reloadBrowserSync']).on('change', function (e) {
        console.log('Resource file ' + e.path + ' has been changed. Updating.');
    });
    gulp.watch('src/**/*.scss', ['sass', 'resources', 'reloadBrowserSync'], function(e){
        console.log('Sass file ' + e.path + ' has been changed. Updating.');
    });

});
開發者ID:benhallouk,項目名稱:HCLC-Portal,代碼行數:28,代碼來源:gulpfile.ts

示例4: watch

function watch() {
	gulp.watch(paths.html, html);
	gulp.watch(paths.sass, styles);
	gulp.watch(paths.ts, compile);
	gulp.watch(paths.res, res);
	gulp.watch(paths.loader, loader);
}
開發者ID:bradtaylor707,項目名稱:asphalt,代碼行數:7,代碼來源:gulpfile.ts

示例5: function

gulp.task('watch', function () {
    gulp.watch(["src/**/*.ts"]).on('change', function () {
    });
    gulp.watch(["src/**/*.html"]).on('change', function () {
    });
    gulp.watch('./src/app/styles/**/*.scss', ['sass']);
    gulp.watch('./src/app/images/**', ['images']);
});
開發者ID:canygt27,項目名稱:angular2-scaffolding,代碼行數:8,代碼來源:gulpfile.ts

示例6: runSequence

gulp.task("watch", () => {
  gulp.watch(`${paths.coffee.watchSources}`, () => {
    runSequence("scripts:build")
  })
  gulp.watch(`${paths.less.watchSources}`, () => {
    runSequence("styles:build")
  })
})
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:8,代碼來源:watch.ts

示例7: function

gulp.task('watch', function () {
    gulp.watch(["client/**/*.ts"], ['compile']).on('change', function (e) {
        console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
    });
    gulp.watch(["client/**/*.html", "client/**/*.css"], ['resources']).on('change', function (e) {
        console.log('Resource file ' + e.path + ' has been changed. Updating.');
    });
});
開發者ID:camphor-scent,項目名稱:camphor,代碼行數:8,代碼來源:gulpfile.ts

示例8: function

gulp.task('watch', function () {
    gulp.watch(["frontend/**/*.ts", "backend/**/*.js" ], ['compile']).on('change', function (e) {
        console.log('Source file ' + e.path + ' has been changed. Compiling.');
    });
    gulp.watch(["frontend/**/*.html", "frontend/**/*.css", "frontend/*.js"], ['resources']).on('change', function (e) {
        console.log('Resource file ' + e.path + ' has been changed. Updating.');
    });
});
開發者ID:Gettor,項目名稱:d20Site,代碼行數:8,代碼來源:gulpfile.ts

示例9: task

task(':watch:devapp', () => {
  watch(join(appDir, '**/*.ts'), [':build:devapp:ts', triggerLivereload]);
  watch(join(appDir, '**/*.scss'), [':build:devapp:scss', triggerLivereload]);
  watch(join(appDir, '**/*.html'), [':build:devapp:assets', triggerLivereload]);

  // The themes for the demo-app are built by the demo-app using the SCSS mixins from Material.
  // Therefore when the CSS files have been changed the SCSS mixins have been refreshed and
  // copied over. Rebuilt the theme CSS using the updated SCSS mixins.
  watch(join(materialOutPath, '**/*.css'), [':build:devapp:scss', triggerLivereload]);
});
開發者ID:jiw0220,項目名稱:jigsaw,代碼行數:10,代碼來源:development.ts

示例10: function

  return function(done) {
    gulp.watch(project.transpiler.source, refreshCb).on('change', onChangeCb);
    gulp.watch(project.markupProcessor.source, refreshCb).on('change', onChangeCb);
    gulp.watch(project.cssProcessor.source, refreshCb).on('change', onChangeCb);

    //see if there are static files to be watched
    if (typeof project.build.copyFiles === 'object') {
      const files = Object.keys(project.build.copyFiles);
      gulp.watch(files, refreshCb).on('change', onChangeCb);
    }
  };
開發者ID:dwarry,項目名稱:AspNetCoreWithAurelia,代碼行數:11,代碼來源:run.ts


注:本文中的gulp.watch函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。