0

This is what I've got.

gulp.src(["app/**/*.js" "!app/environment.*.js","app/environment.prod.js"], {read: false})

I was expecting it to include only environment.prod.js and exclude all other environment.*.js. But it excludes all of them.

Only way I could get it to work is to not use wildcard for exclusion and repeat them like this.

gulp.src(["app/**/*.js",
          "!app/environment.test.js", 
          "!app/environment.uat.js",
          "app/environment.prod.js"], {read: false});

Any ideas?

lahsrah
  • 9,013
  • 5
  • 37
  • 67

1 Answers1

1

If you only need the app/environment.prod.js, then just pass that to gulp.src

Edit

gulp.src(["app/**/*.js", "!app/environment.+(test|uat|bla).js"], {read: false})

Will exclude: app/environment.test.js, app/environment.uat.js, app/environment.bla.js.

For reference, see this: https://github.com/isaacs/minimatch#usage

I refer to minimatch project because internally gulp uses that for their purposes

slackmart
  • 4,754
  • 3
  • 25
  • 39