For environment where there isn't a second parameter to set the exclude, we can achieve such an exception using the pattern demonstrated in the example bellow:
Pattern
/src/**/!(els)/*.scss
structure
/src/style/kit.scss
/src/style/els/some.scss
/src/style/els/two.scss
result
it will select only /src/style/kit.scss
We can use http://www.globtester.com or https://www.digitalocean.com/community/tools/glob to test quickly online.
update
If we are working with Gulp task runner. Or some other tools or classes that offers a second or multiple parameters for exclusion. Or just multiple globs selectors that support exclusion too. Then We can do as the example bellow for gulp show:
for Gulp
We pass an array instead of just a string (multiple globs selectors, one apply after another to add more files or to exclude)
src(['src/style/**/*.{scss,sass}', '!(src/style/els/**)'])
We can have multiple exclusions
watch(['src/style/**/*.{scss,sass}', '!(src/style/els/**)', '!(src/style/_somefileToExclude.scss)'])
In gulp you can use that, with any method that support an array as globs selectors. src
and watch
are what i used that for.
Note: If you want to exclude a folder and all it's sub folders we use **
as above and not **/*
which will not work. If you need some specific files types (extension) then you can use **/*.scss
for example.