Questions tagged [gulp-concat]

gulp-concat is a gulp plugin for files concatenation.

gulp-concat is a gulp plugin used to concatenate files.

Usage example:

var concat = require('gulp-concat');

gulp.task('scripts', function() {
  gulp.src('./lib/*.js')
    .pipe(concat('all.js'))
    .pipe(gulp.dest('./dist/'))
});

gulp-concat npm package: https://www.npmjs.com/package/gulp-concat.

214 questions
38
votes
4 answers

How can I use gulp to replace a string in a file?

I am using gulp to uglify and make ready my javascript files for production. What I have is this code: var concat = require('gulp-concat'); var del = require('del'); var gulp = require('gulp'); var gzip = require('gulp-gzip'); var less =…
Alan2
  • 23,493
  • 79
  • 256
  • 450
36
votes
2 answers

How to tell Gulp to skip or ignore some files in gulp.src([...])?

How can I tell Gulp to skip or ignore some files in gulp.src([...])? For instance, I don't want to compress and concat this file in my css/ folder - 'css/ignnore.css'? var autoprefix = require('gulp-autoprefixer'), concat =…
Run
  • 54,938
  • 169
  • 450
  • 748
15
votes
2 answers

gulp concat after sass

I would like to take the sass output and concat it to another css regular file. example: animate.css app.scss return gulp.src('app.scss') .pipe(sass({ errLogToConsole: true })) .pipe(concat(['animate.css',…
Tzook Bar Noy
  • 11,337
  • 14
  • 51
  • 82
11
votes
2 answers

What about this combination of gulp-concat and lazypipe is causing an error using gulp 4?

I'm upgrading from Gulp 3 to 4, and I'm running into an error: The following tasks did not complete: build Did you forget to signal async completion? I understand what it's saying, but can't understand why this code is triggering it. Error or not,…
goodforenergy
  • 520
  • 1
  • 4
  • 18
10
votes
2 answers

Gulp.js: task based on forEach loop

I have an array of objects that looks like the following. var bundles = [ { src: 'js/my-component/*.js', bundleName: 'my-component.js' }, { src: 'js/my-other-component/*.js', bundleName: 'my-other-component.js' } ] I want…
gkiely
  • 2,987
  • 1
  • 23
  • 37
9
votes
3 answers

gulpfile error recived a non-Vinyl object

I'm trying to convert a old gulpjs file to es6 but i keep getting this error message in the concat task: Error: Recived a non-Vinyl object in dest() My gulpfile.js: import gulp from 'gulp'; /*********** Jade and Pug templating ***********/ import…
9
votes
1 answer

Preserving sourcemaps when merging JS streams (to concat lib dependencies with browserify bundle)

In my current workflow I need to create browserify bundles, but also wish to concat non-commonjs js libraries to the beginning of the file to expose global variables but also reduce the number of http requests and size of js files. (Some of these…
Gaffen
  • 91
  • 1
  • 4
8
votes
2 answers

gulp-order : not Ordering properly

Gulp newbie here, I downloaded gulp-order for ordering js files when concating *.js because some of my javascript files require jquery to load first. Below are my gulpfile.js that have order,concat,rename & uglify. var date = new Date(); var uniq =…
Mavichow
  • 1,213
  • 17
  • 41
7
votes
2 answers

Gulp SASS - Use @import without compiling scss -> css

I know this is probably a weird question, but stick with me. :) Is it possible to use gulp sass (or other gulp plugins) to read a single .scss file with multiple @import statements, and import/concat all those @import-ed files to a single .scss…
Anthony F.
  • 545
  • 1
  • 5
  • 20
7
votes
1 answer

Gulp bundle then minify

I'm creating 3 minified bundles for my application. I have 2 tasks to do this, minify, and bundle. Minify has a dependency on bundle. If I run minify, both tasks run with no errors. The bundles are created, but the minified files are not. If I…
Ryan Langton
  • 6,294
  • 15
  • 53
  • 103
7
votes
1 answer

Combining multiple src streams in gulp?

I'm wondering if there's any way to combine these two separate tasks into one. This concat-js task requires a generated file to exist prior to running. The task cache-angular-templates generates that file. The generated file needs to be included in…
core
  • 32,451
  • 45
  • 138
  • 193
7
votes
1 answer

Uglify Minify and generate source map with Gulp

Can someone explain how to uglify, then concat and finally generate a source map using gulp? I cannot seem to get it working. I am not seeing anything in the API's about this but seems to me that it should be supported. The point is to generate the…
Subtubes
  • 15,851
  • 22
  • 70
  • 105
6
votes
2 answers

Angular module().factory() is not a function after concat (gulp)

Trying to concat/uglify my angular app using gulp for the last few hours, i have stripped down whole process to simple concat, and even removed angular file from concat process to a separate