本文整理匯總了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);
});
示例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);
});
示例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.');
});
});
示例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);
}
示例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']);
});
示例6: runSequence
gulp.task("watch", () => {
gulp.watch(`${paths.coffee.watchSources}`, () => {
runSequence("scripts:build")
})
gulp.watch(`${paths.less.watchSources}`, () => {
runSequence("styles:build")
})
})
示例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.');
});
});
示例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.');
});
});
示例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]);
});
示例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);
}
};