gulp-community / gulp-concat

Streaming concat middleware for gulp
MIT License
792 stars 127 forks source link

Missing path in file options #133

Closed majabee closed 7 years ago

majabee commented 7 years ago

Module Versions: node: 7.2.1 npm: 3.10.10 gulp: 3.9.1 gulp-concat: 2.6.1 gulp-sourcemaps: 2.2.1

When I´m running my gulp concat task i get this error message:

[21:34:18] Starting 'concatjs'... [21:34:18] 'concatjs' errored after 15 ms [21:34:18] Error: gulp-concat: Missing path in file options at module.exports (/Users/xx/yy/sites/projects/gulptest/node_modules/gulp-concat/index.js:32:11) at Gulp. (/Users/xx/yy/sites/projects/gulptest/gulpfile.js:242:9) at module.exports (/Users/xx/yy/sites/projects/gulptest/node_modules/orchestrator/lib/runTask.js:34:7) at Gulp.Orchestrator._runTask (/Users/xx/yy/sites/projects/gulptest/node_modules/orchestrator/index.js:273:3) at Gulp.Orchestrator._runStep (/Users/xx/yy/sites/projects/gulptest/node_modules/orchestrator/index.js:214:10) at Gulp.Orchestrator.start (/Users/xx/yy/sites/projects/gulptest/node_modules/orchestrator/index.js:134:8) at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20 at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) at Module.runMain (module.js:607:11) at run (bootstrap_node.js:420:7) at startup (bootstrap_node.js:139:9) at bootstrap_node.js:535:3

my gulpfile looks like this:

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

gulp.task('concatjs', function() {
  return gulp.src([
    './src/core/scripts/vendor/source1.js',
    './src/core/scripts/vendor/source2.js'
  ])
  .pipe(sourcemaps.init())
  .pipe(concat(['global.js'], {newLine: ';'}))
  .pipe(sourcemaps.write())
  .pipe(gulp.dest('./build/scripts'));
});

gulp.task('default', ['concatjs']);

What can I do to solve this and what is the problem.

yocontra commented 7 years ago

concat('global.js', {newLine: ';'}) not concat(['global.js'], {newLine: ';'}) - the argument is a string not an array

majabee commented 7 years ago

THANK YOU