本文整理汇总了TypeScript中browser-sync.reload函数的典型用法代码示例。如果您正苦于以下问题:TypeScript reload函数的具体用法?TypeScript reload怎么用?TypeScript reload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reload函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
let changed = files => {
if (!(files instanceof Array)) {
files = [files];
}
browserSync.reload(files);
};
示例2: changed
export function changed(files) {
if(!(files instanceof Array)) {
files = [files];
}
if (sync.active) {
sync.reload(files);
}
};
示例3: buildStyles
/**
*
*/
function buildStyles() {
return src(_src())
.pipe(plug.sourcemaps.init())
.pipe(plug.sass())
.pipe(plug.sourcemaps.write('.'))
.pipe(dest('tmp/serve'))
.pipe(browserSync.reload({ stream: true }))
.pipe(dest('src'))
}
示例4:
let changed = files => {
if (!(files instanceof Array)) {
files = [files];
}
// if (ENABLE_HOT_LOADING) {
// ng2HotLoader.onChange(files);
// } else {
browserSync.reload(files);
// }
};
示例5:
gulp.task("less", () => {
gulp.src(lessPath)
.pipe(p.plumber())
.pipe(p.sourcemaps.init())
.pipe(p.less())
.pipe(p.autoprefixer())
.pipe(p.sourcemaps.write())
.pipe(gulp.dest("dist/public"))
.pipe(browserSync.reload({ stream: true }));
});
示例6:
let changed = (files: any) => {
if (!(files instanceof Array)) {
files = [files];
}
// if (ENABLE_HOT_LOADING) {
// ng2HotLoader.onChange(files);
// } else {
//TODO: Figure out why you can't pass a file to reload
browserSync.reload(files.path);
//}
};
示例7:
let changed = (files: any) => {
if (!(files instanceof Array)) {
files = [files];
}
let onlyStylesChanged =
files
.map((f:string) => path.parse(f).ext)
.reduce((prev:string, current:string) => prev && (current === '.scss' || current === '.css'), true);
// if (ENABLE_HOT_LOADING) {
// ng2HotLoader.onChange(files);
// } else {
//TODO: Figure out why you can't pass a file to reload
if (onlyStylesChanged === false) {
browserSync.reload(files);
}else {
browserSync.reload('*.css');
}
//}
};
示例8:
let changed = (files: any) => {
if (!(files instanceof Array)) {
files = [files];
}
let onlyStylesChanged =
files
.map((f:string) => path.parse(f))
.reduce((prev:boolean, current:path.ParsedPath) => {
return prev && (current.ext === '.scss' || current.ext === '.css') && !current.name.endsWith(".component")
}, true);
//
// if (ENABLE_HOT_LOADING) {
// ng2HotLoader.onChange(files);
// } else {
//TODO: Figure out why you can't pass a file to reload
if (onlyStylesChanged === false) {
browserSync.reload();
} else {
browserSync.reload('**/*.css');
}
//}
};
示例9: browserSync
baseDir: "./"
}
};
// config only
browserSync(config);
// config + callback
browserSync(config, function (err, bs) {
if (!err) {
console.log("BrowserSync is ready!");
}
});
// browser reload
browserSync.reload();
// single file
browserSync.reload( "styles.css" );
// multiple files
browserSync.reload( ["styles.css", "ie.css"] );
// streams support
browserSync.reload( { stream: true } );
browserSync.notify("Compiling, please wait!");
browserSync.notify("HTML <span color='green'>is supported</span> too!");
// Since 1.3.0, specify a timeout