本文整理汇总了TypeScript中gulpclass.MergedTask函数的典型用法代码示例。如果您正苦于以下问题:TypeScript MergedTask函数的具体用法?TypeScript MergedTask怎么用?TypeScript MergedTask使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MergedTask函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: compileBundles
// -------------------------------------------------------------------------
// Packaging and Publishing tasks
// -------------------------------------------------------------------------
/**
* Compiles and compiles bundles.
*/
@MergedTask()
compileBundles() {
const amdTsProject = ts.createProject("tsconfig.json", {
module: "amd",
outFile: packageName + ".amd.js",
typescript: require("typescript")
});
const systemTsProject = ts.createProject("tsconfig.json", {
module: "system",
outFile: packageName + ".system.js",
typescript: require("typescript")
});
const amdPureTsProject = ts.createProject("tsconfig.json", {
module: "amd",
outFile: packageName + ".pure.amd.js",
noEmitHelpers: true,
noImplicitUseStrict: true,
typescript: require("typescript")
});
const systemPureTsProject = ts.createProject("tsconfig.json", {
module: "system",
outFile: packageName + ".pure.system.js",
noEmitHelpers: true,
noImplicitUseStrict: true,
typescript: require("typescript")
});
return [
gulp.src("build/bundle/**/*.ts")
.pipe(amdTsProject()).js
.pipe(gulp.dest("build/package")),
gulp.src("build/bundle/**/*.ts")
.pipe(systemTsProject()).js
.pipe(gulp.dest("build/package")),
gulp.src("build/bundle/**/*.ts")
.pipe(amdPureTsProject()).js
.pipe(gulp.dest("build/package")),
gulp.src("build/bundle/**/*.ts")
.pipe(systemPureTsProject()).js
.pipe(gulp.dest("build/package"))
];
}
示例2: browserCompile
@MergedTask()
browserCompile() {
const tsProject = ts.createProject("tsconfig.json", {
module: "es2015",
"lib": ["es5", "es6", "dom"],
typescript: require("typescript")
});
const tsResult = gulp.src(["./build/browser/src/**/*.ts", "./node_modules/reflect-metadata/**/*.d.ts", "./node_modules/@types/**/*.ts"])
.pipe(sourcemaps.init())
.pipe(tsProject());
return [
tsResult.dts.pipe(gulp.dest("./build/package/browser")),
tsResult.js
.pipe(sourcemaps.write(".", { sourceRoot: "", includeContent: true }))
.pipe(gulp.dest("./build/package/browser"))
];
}
示例3: packageCompile
/**
* Copies all sources to the package directory.
*/
@MergedTask()
packageCompile() {
const tsProject = ts.createProject("tsconfig.json", {
typescript: require("typescript")
});
const tsResult = gulp.src([
"./src/**/*.ts",
"./node_modules/@types/**/*.ts",
])
.pipe(sourcemaps.init())
.pipe(tsProject());
return [
tsResult.dts.pipe(gulp.dest("./build/package")),
tsResult.js
.pipe(sourcemaps.write(".", { sourceRoot: "", includeContent: true }))
.pipe(gulp.dest("./build/package"))
];
}
示例4: uglify
/**
* Uglifys bundles.
*/
@MergedTask()
uglify() {
return [
gulp.src(`./build/package/${packageName}.pure.amd.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.pure.amd.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/${packageName}.pure.system.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.pure.system.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/${packageName}.amd.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.amd.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/${packageName}.system.js`)
.pipe(uglify())
.pipe(rename(`${packageName}.system.min.js`))
.pipe(gulp.dest("./build/package")),
];
}
示例5: uglify
/**
* Uglifys bundles.
*/
@MergedTask()
uglify() {
return [
gulp.src(`./build/package/class-transformer.pure.amd.js`)
.pipe(uglify())
.pipe(rename(`class-transformer.pure.amd.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/class-transformer.pure.system.js`)
.pipe(uglify())
.pipe(rename(`class-transformer.pure.system.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/class-transformer.amd.js`)
.pipe(uglify())
.pipe(rename(`class-transformer.amd.min.js`))
.pipe(gulp.dest("./build/package")),
gulp.src(`./build/package/class-transformer.system.js`)
.pipe(uglify())
.pipe(rename(`class-transformer.system.min.js`))
.pipe(gulp.dest("./build/package")),
];
}
示例6: MergedTask
export function MergedTask(metaArgs?: TaskMetadataArgs | string): Function {
const args = parseMetaArgs(metaArgs);
return gulpclass.MergedTask(args.name);
}