本文整理汇总了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", () => {