1

I have this Gulp snippet:

gulp.src(['./assets/**/*.!(coffee|scss)', '!assets/images{,/**}'])
    .pipe(gulp.dest('.tmp/public'))

And this folder structure:

  • assets
    • js
      • A.coffee
      • A.B.coffee
      • A.B.C.coffee
      • X.js

The intention is to copy everything except:

  • the contents of assets/images
  • any and all CoffeeScript files

However, this glob pattern does not exclude A.B and A.B.C.coffee.

What is the correct pattern to do this?

amyspark
  • 520
  • 1
  • 4
  • 15

1 Answers1

2

You are close. Try this

gulp.src(['./assets/**/!(*.coffee|*.scss)', '!assets/images'])
    .pipe(gulp.dest('.tmp/public'))
Lim H.
  • 9,870
  • 9
  • 48
  • 74