本文整理汇总了TypeScript中gulp-connect.reload函数的典型用法代码示例。如果您正苦于以下问题:TypeScript reload函数的具体用法?TypeScript reload怎么用?TypeScript reload使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reload函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
gulp.task('html', () => {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
示例2: task
task('e2e.build', function () {
var indexTemplate = template(
readFileSync(`${SCRIPTS_ROOT}/${E2E_NAME}/e2e.template.dev.html`).toString()
)({
buildConfig: buildConfig
});
// Get each test folder with src
var tsResult = src([
'src/components/*/test/*/**/*.ts',
'!src/components/*/test/*/**/*.spec.ts'
])
.pipe(cache('e2e.ts'))
.pipe(tsc(getTscOptions(), undefined, tscReporter))
.on('error', function (error) {
console.log(error.message);
})
.pipe(gulpif(/app-module.js$/, createIndexHTML()))
.pipe(gulpif(/e2e.js$/, createPlatformTests()));
var testFiles = src([
'src/components/*/test/*/**/*',
'!src/components/*/test/*/**/*.ts'
])
.pipe(cache('e2e.files'));
return merge([
tsResult,
testFiles
])
.pipe(rename(function (file) {
file.dirname = file.dirname.replace(sep + 'test' + sep, sep);
}))
.pipe(dest(DIST_E2E_ROOT))
.pipe(connect.reload());
function createIndexHTML() {
return obj(function (file, enc, next) {
this.push(new VinylFile({
base: file.base,
contents: new Buffer(indexTemplate),
path: join(dirname(file.path), 'index.html'),
}));
next(null, file);
});
}
function createPlatformTests() {
let platforms = [
'android',
'ios',
'windows'
];
let testTemplate = template(readFileSync(`${SCRIPTS_ROOT}/${E2E_NAME}/e2e.template.js`).toString());
return obj(function (file, enc, next) {
let self = this;
let relativePath = dirname(file.path.replace(/^.*?src(\/|\\)components(\/|\\)/, ''));
relativePath = relativePath.replace('/test/', '/');
let contents = file.contents.toString();
platforms.forEach(function (platform) {
let platformContents = testTemplate({
contents: contents,
buildConfig: buildConfig,
relativePath: relativePath,
platform: platform
});
self.push(new VinylFile({
base: file.base,
contents: new Buffer(platformContents),
path: file.path.replace(/e2e.js$/, platform + '.e2e.js')
}));
});
next();
});
}
});
示例3: compileTypeScript
gulp.task("typescript:dev", () => {
return compileTypeScript(devProject)
.pipe(gulp.dest(Paths.TypeScriptDist))
.pipe(connect.reload());
});
示例4: streamqueue
gulp.task("typescript:prod", ["create-empty-js"], () => {
return streamqueue({ objectMode: true }, getModuleLoader(), getProdSystemConfig(), getTypeScriptBundle(), getSystemImport())
.pipe(concat(bundleFileName))
.pipe(gulp.dest(Paths.ScriptsDist))
.pipe(connect.reload());
});
示例5: triggerLivereload
export function triggerLivereload() {
console.log(chalk.yellow('Server: Changes were detected and a livereload was triggered.'));
return src('dist').pipe(gulpConnect.reload());
}
示例6:
gulp.task('stylus', () => {
gulp.src('./app/stylus/*.styl')
// .pipe(stylus()) // just here for demonstration purposes
.pipe(gulp.dest('./app/css'))
.pipe(connect.reload());
});