Search code examples
javascripttypescriptgulpvisual-studio-2017

Gulp Dest() not Outputting File


I am having a difficult time getting gulp.dest to output anything anywhere. I specifically want to just output to the root of the project (I'm hijacking an ASP.NET Core project for TypeScript development only). I'd really appreciate some help on how I can get dest to do what I want. Here's my current 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"
    ));
});

Solution

  • I think

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

    is all you want.