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