Open tinyfly opened 9 years ago
Oh my, that is one big vendor file. Looking at the amount and nature of the files you are including, I'd say it's actually running out of memory while processing.
This could be an issue with the V8 RegExp as it fails when it reaches a heap of 64mb (https://code.google.com/p/v8/issues/detail?id=3878). As the file grows with the includes, the regex has to work harder. I'll have to look into avoiding performing regex multiple times in an update.
You could try using globs to include more than one file in a single directive.
//= require ../../../../vendor/bower/**/jquery.jqplot.js
//= require ../../../../vendor/bower/**/jqplot.*.js
Since the file grows in larger chunks, it might allow more things to be included before breaking the memory limit. However, it might not do anything in this case since the error happens early.
You could also try using gulp-include
version 1.1.1
, which handled includes slightly differently, and might be less heavy on huge files.
I have similar issue. Js code randomly cuts. I have tried v 1.1.1, but no luck. I using code like this:
return gulp.src('myfile.js')
.pipe(plugins.rename({suffix:'.dev'}))
.pipe(plugins.include()) // parse include patterns
.pipe(gulp.dest('dist'));
I found some resolve for my issue. There was file trims in base of 16kb (0 - 16kb - 32kb etc). I debugged 'gulp-include' module and did not found problems there. All files has normal length. But file still trims in random way. The module gulp-sync shutdown script without syncing all streams I suggest. There code with wait function that resolve my issue, but not clear:
return gulp.src('myfile.js')
.pipe(plugins.rename({suffix:'.dev'}))
.pipe(plugins.include()) // parse include patterns
.pipe(gulp.dest('dist'))
// wait until all file will be written to file system
.pipe(function(){
return require('gulp-include/node_modules/event-stream').map(function(file, callback){
setTimeout(function(){
callback(null, file);
},1000);
});
}())
I'm trying to run gulp-include on a
plugins.js
that has require statements for all my third-party JS used in my project. I get to the restangular.js line before I get the above error. It isn't specific to restangular because if I put anything after the first 14 requires it'll give me the invalid string error. If I only do the first 14 files it compiles fine.Here is my gulp task:
Here is my plugin.js file: