Skip to content Skip to sidebar Skip to footer

How Do I Ignore A File Using Gulp?

I have the following folder and file structure: Vendor bootstrap css -bootstrap.css js -bootstrap.js font-awesome css -font-awesome.css

Solution 1:

You are almost there, the exclamation character is for it '!', just need to pass it as array:

eg:

stream.queue(
  gulp.src([
    'src/vendor/theme/**/*.css',
    '!src/vendor/theme/theme-responsive.css'
  ]);
);

For more information: http://jb.demonte.fr/blog/production-package-with-gulp-js/

Hope this helps.

Solution 2:

Try using gulp-concat. Files will be concatenated in the order that they are specified in the gulp.src function. https://www.npmjs.org/package/gulp-concat

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

gulp.task('scripts', function() {
    gulp.src(['src/vendor/bootstrap/**/*.css', 
              'src/vendor/font-awesome/**/*.css', 
              'src/vendor/nivo-slider/**/*.css', 
              'src/vendor/theme/theme.css',
              'src/vendor/theme/theme-animate.css',
              'src/vendor/theme/theme-blog.css',
              'src/vendor/theme/theme-shop.css',
              'src/vendor/theme/theme-responsive.css'])
        .pipe(concat('app.css'))
        .pipe(gulp.dest('public/css/'))
    ;
});

Post a Comment for "How Do I Ignore A File Using Gulp?"