Control Gulp output paths with gulp.src base and gulp.dest
Use gulp.src globs with an explicit base, pipe JavaScript through gulp-uglify, and write output with gulp.dest; verify with --verbose and inspect dist/js.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use gulp.src globs with an explicit base, pipe JavaScript through gulp-uglify, and write output with gulp.dest; verify with --verbose and inspect dist/js.
Preserving Nested Directory Structure with gulp.src Base Option In Gulp 4.x, the gulp.src stream attaches a base path to each Vinyl file. When the base option is omitted, Gulp defaults to the glob stem before the first wildcard. gulp.dest writes files by appending file.relative to the destination directory, so the final output hierarchy depends entirely on f
Goal: Choose between incremental and full re-runs for a Gulp 4 build that processes a large TypeScript source tree. Constraint: Faster rebuilds are needed, but outputs must not go stale when non-globbed inputs such as tsconfig.json or imported templates change. Uncertainty: gulp.lastRun(task) with gulp.src({ since }) limits processing to files changed since
When gulp.src is configured with a base option, the resulting file paths written by gulp.dest sometimes differ from expectations, especially when nested directories or gulp.series transformations are involved. In practice, setting base: 'src' on a glob like src/**/*.js should preserve the relative structure under dist . However, if the source tree contains s