本文整理匯總了TypeScript中gulp-shell.task函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript task函數的具體用法?TypeScript task怎麽用?TypeScript task使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了task函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
gulp.task('npm', () =>
shell.task(['npm prune'])
示例2: typescriptTask
DIR_TMP,
DIR_DST,
DIR_SRC,
copyHtmlTask,
typescriptTask
} from './common.ts';
gulp.task('clean', del.bind(null, [DIR_TMP, DIR_DST]));
gulp.task('ts', () => typescriptTask());
gulp.task('copy.html', () => copyHtmlTask());
gulp.task('wcs', shell.task([
`web-component-shards \
-r ${DIR_TMP} \
-e ${getShards().join(' ')}`
]));
gulp.task('htmlmin', () => {
return gulp.src(`${path.join(DIR_TMP, DIR_DST)}/**/*.html`)
.pipe(htmlmin(htmlminOptions))
.pipe(gulp.dest(DIR_DST));
});
gulp.task('gzip', () => {
return gulp.src(`${DIR_DST}/**/*.{html,js,css,svg}`)
.pipe(gzip({gzipOptions: {level: 6}, threshold: '1kb'}))
.pipe(gulp.dest(DIR_DST));
});
示例3: merge
if(minify) {
js = js.pipe(uglify());
}
js = js
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./"));
return merge([dts, js]);
});
gulp.task('coverage', ['compile'], shell.task([
"ts-node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha test/*.ts"
]));
gulp.task("typedoc", function() {
return gulp.src(["src/*.ts"])
.pipe(typedoc({
module: "commonjs",
out: "./doc",
theme: "minimal",
name: "Updraft",
target: "es5",
mode: "file",
includeDeclarations: true
}));
});
示例4: require
ďťż/// <reference path="../_references.ts" />
'use strict';
import gulp = require("gulp");
var sequence: Function = require("run-sequence");
var connect: any = require("gulp-connect");
var shell: any = require("gulp-shell");
var targetConf: string = "../kspRemoteTechPlannerTest/conf.js";
var targetRoot: string = "../kspRemoteTechPlanner/";
var targetMinifiedRoot: string = "../deploy";
gulp.task("test:wdm-update",
shell.task("webdriver-manager update")
);
gulp.task("test:server-start",() => {
connect.server({
root: targetRoot,
port: 8080
});
});
gulp.task("test-minified:server-start",() => {
connect.server({
root: targetMinifiedRoot,
port: 8080
});
});
示例5: runSequence
gulp.task('task:build', done => runSequence(
'task:compile',
'task:deploy:prep',
done
))
gulp.task('task:compile', done => runSequence(
'task:compile:angular',
'task:compile:rollup',
'task:compile:downlevel',
done
));
gulp.task('task:compile:angular', shell.task([
'node_modules/.bin/ngc'
]));
gulp.task('task:compile:rollup', done => {
rollup
.rollup({
entry: 'tmp/ngc/app/main.js',
plugins: [
new RxRewriter(),
rollupResolveNode({
jsnext: true,
main: true,
extensions: ['.js'],
preferBuiltins: false
})
]
示例6:
gulp.task("tsconfig", () => {
return gulp
.src([
"./lib/**/*.ts",
"!./lib/**/*.d.ts",
"./test/**/*.ts",
"!./test/**/*.d.ts",
"./typings/**/*.ts",
"./node_modules/commandpost/commandpost.d.ts",
"./node_modules/typescript/lib/lib.es6.d.ts"
])
.pipe(tsconfig());
});
gulp.task("tsc", shell.task([
"node_modules/.bin/tsc -p ./"
]));
gulp.task("tslint", () => {
return gulp
.src([
"./lib/**/*.ts",
"./test/**/*.ts"
])
.pipe(tslint({
config: "/tslint.json"
}))
.pipe(tslint.report("verbose"));
});
gulp.task("espower", () => {