本文整理汇总了TypeScript中gulpclass.Task函数的典型用法代码示例。如果您正苦于以下问题:TypeScript Task函数的具体用法?TypeScript Task怎么用?TypeScript Task使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Task函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: unit
/**
* Runs unit-tests.
*/
@Task()
unit() {
chai.should();
chai.use(require("sinon-chai"));
return gulp.src("./build/es5/test/unit/**/*.js")
.pipe(mocha());
}
示例2: packagePublishNext
/**
* Publishes a package to npm from ./build/package directory with @next tag.
*/
@Task()
packagePublishNext() {
return gulp.src("package.json", { read: false })
.pipe(shell([
"cd ./build/package && npm publish --tag next"
]));
}
示例3: npmPublish
/**
* Publishes a package to npm from ./build/package directory.
*/
@Task()
npmPublish() {
return gulp.src("package.json", { read: false })
.pipe(shell([
"cd ./build/package && npm publish"
]));
}
示例4: compile
/**
* Runs typescript files compilation.
*/
@Task()
compile() {
return gulp.src("package.json", { read: false })
.pipe(shell([
"\"node_modules/.bin/ngc\" -p tsconfig-aot.json"
]));
}
示例5: packageReplaceReferences
/**
* Removes /// <reference from compiled sources.
*/
@Task()
packageReplaceReferences() {
return gulp.src("./build/package/**/*.d.ts")
.pipe(replace(`/// <reference types="node" />`, ""))
.pipe(replace(`/// <reference types="chai" />`, ""))
.pipe(gulp.dest("./build/package"));
}
示例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/**/*.js")
.pipe(mocha());
}
示例7: del
// -------------------------------------------------------------------------
// General tasks
// -------------------------------------------------------------------------
/**
* Cleans build folder.
*/
@Task()
clean(cb: Function) {
return del([
"build/**",
"!build",
"!build/package",
"!build/package/node_modules",
"!build/package/node_modules/**"
], cb);
}
示例8: tslint
// -------------------------------------------------------------------------
// Run tests tasks
// -------------------------------------------------------------------------
/**
* Runs ts linting to validate source code.
*/
@Task()
tslint() {
return gulp.src(["./src/**/*.ts", "./test/**/*.ts", "./sample/**/*.ts"])
.pipe(tslint())
.pipe(tslint.report(stylish, {
emitError: true,
sort: true,
bell: true
}));
}
示例9: coveragePost
/**
* Runs post coverage operations.
*/
@Task("coveragePost", ["coveragePre"])
coveragePost() {
chai.should();
chai.use(require("sinon-chai"));
chai.use(require("chai-as-promised"));
return gulp.src(["./build/es5/test/**/*.js"])
.pipe(mocha())
.pipe(istanbul.writeReports());
}
示例10: browserCopySources
// -------------------------------------------------------------------------
// Build and packaging for browser
// -------------------------------------------------------------------------
/**
* Copies all source files into destination folder in a correct structure.
*/
@Task()
browserCopySources() {
return gulp.src([
"./src/**/*.ts",
"!./src/commands/*.ts",
"!./src/cli.ts",
"!./src/typeorm.ts",
"!./src/typeorm-model-shim.ts",
"!./src/platform/PlatformTools.ts"
])
.pipe(gulp.dest("./build/browser/src"));
}