本文整理汇总了TypeScript中gulpclass/Decorators.Task函数的典型用法代码示例。如果您正苦于以下问题:TypeScript Task函数的具体用法?TypeScript Task怎么用?TypeScript Task使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Task函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: watch
@Task()
watch() {
gulp.watch('src/**/*.ts', this.buildTypescript);
nodemon({
script: './dist/src/server.js'
});
}
示例2:
@Task('ts::lint')
tslint() {
gulp.src(['./app/**/*.ts'])
.pipe(tslint())
.pipe(tslint.report('verbose'))
.pipe(debug());
}
示例3: readpkgjson
/**
* Read package.json task
*
* It reads the data of the devconfig object in the package.json file
*/
@Task('config::readpkgjson')
readpkgjson(): any {
var configobject = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
if (configobject && configobject.devconfig) {
this.config = configobject.devconfig;
}
}
示例4: unit
/**
* Runs unit-tests.
*/
@Task()
unit() {
chai.should();
chai.use(require("sinon-chai"));
return gulp.src("./build/es5/test/unit/**/*.js")
.pipe(mocha());
}
示例5: npmPublish
// -------------------------------------------------------------------------
// Packaging and Publishing tasks
// -------------------------------------------------------------------------
/**
* Publishes a package to npm from ./build/package directory.
*/
@Task()
npmPublish() {
return gulp.src("*.js", { read: false })
.pipe(shell([
"cd ./build/package && npm publish"
]));
}
示例6: unit
/**
* Runs unit-tests.
*/
@Task()
unit() {
chai.should();
chai.use(require("sinon-chai"));
chai.use(require("chai-as-promised"));
return gulp.src("./build/compiled/test/unit/**/*.js")
.pipe(mocha());
}
示例7: lintTS
@Task('lint:ts')
public lintTS()
{
const tslint = require('gulp-tslint');
return gulp.src(['./src/**/*.ts', './Gulpfile.ts'])
.pipe(tslint())
.pipe(tslint.report('prose'));
}
示例8: functional
/**
* Runs functional tests.
*/
@Task()
functional() {
chai.should();
chai.use(require("sinon-chai"));
chai.use(require("chai-as-promised"));
return gulp.src("./build/es5/test/functional/**/*.js")
.pipe(mocha());
}
示例9: useref
@Task('useref')
useref() {
return gulp.src('app/*.html')
.pipe(useref())
.pipe(gulpIf('*.js', uglify()))
.pipe(gulpIf('*.css', cssnano()))
.pipe(gulp.dest('dist'))
}