本文整理匯總了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'))
}