Last active
          January 2, 2016 15:29 
        
      - 
      
 - 
        
Save rooftopsparrow/8323712 to your computer and use it in GitHub Desktop.  
    OSX EMFILE issue with gulp
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # After finished just run `gulp` | |
| mkdir gulptest && cd gulptest | |
| mkdir js | |
| cat <<EOF > js/test.js | |
| function foo() { | |
| console.log("bar"); | |
| } | |
| EOF | |
| for n in {001..242}; do | |
| cp js/test.js js/test-$n.js | |
| done | |
| cat <<EOF > Gulpfile.js | |
| var gulp = require('gulp'); | |
| var jshint = require('gulp-jshint'); | |
| var concat = require('gulp-concat'); | |
| var uglify = require('gulp-uglify'); | |
| var rename = require('gulp-rename'); | |
| gulp.task('lint', function() { | |
| gulp.src('./js/*.js') | |
| .pipe(jshint()) | |
| .pipe(jshint.reporter('default')); | |
| }); | |
| gulp.task('scripts', function() { | |
| gulp.src('./js/*.js') | |
| .pipe(concat('all.js')) | |
| .pipe(gulp.dest('./dist')) | |
| .pipe(rename('all.min.js')) | |
| .pipe(uglify()) | |
| .pipe(gulp.dest('./dist')); | |
| }); | |
| gulp.task('default', function(){ | |
| gulp.run('lint', 'scripts'); | |
| }); | |
| EOF | |
| npm install gulp gulp-jshint gulp-concat gulp-uglify gulp-rename | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment