简体   繁体   English

Gulp Dest()不输出文件

[英]Gulp Dest() not Outputting File

I am having a difficult time getting gulp.dest to output anything anywhere. 我很难把gulp.dest输出到任何地方。 I specifically want to just output to the root of the project (I'm hijacking an ASP.NET Core project for TypeScript development only). 我特别想只输出到项目的根目录(我仅劫持一个用于TypeScript开发的ASP.NET Core项目)。 I'd really appreciate some help on how I can get dest to do what I want. 我会很感激我如何能得到一些帮助dest做我想做的。 Here's my current gulpfile.js: 这是我当前的gulpfile.js:

/// <binding AfterBuild="build" Clean="clean" ProjectOpened="watch" />

"use strict";

const del = require("del"),
    gulp = require("gulp"),
    gulpConcat = require("gulp-concat"),
    gulpRename = require("gulp-rename"),
    gulpTerser = require("gulp-terser");

gulp.task("concatenate", () => {
    return gulp.src([
        "*.js",
        "!gulpfile.js"
    ])
        .pipe(gulpConcat("concatenated.js"))
        .pipe(gulp.dest("/"));
});

gulp.task("minify", () => {
    return gulp.src("concatenated.js")
        .pipe(gulpTerser())
        .pipe(gulpRename("min.js"))
        .pipe(gulp.dest("/"));
});

gulp.task("clean", () => del([
    "*.js",
    "!gulpfile.js"
]));

gulp.task("build", gulp.series(
    "concatenate",
    "minify"
));

gulp.task("watch", () => {
    gulp.watch([
        "*.ts"
    ], gulp.series(
        "build"
    ));
});

I think 我认为

  .pipe(gulp.dest('.'))

is all you want. 就是你想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM