johan-v-r / LibSassBuilder

Sass builder for .NET projects
MIT License
99 stars 14 forks source link

Directory command: problem with excluded directories #23

Closed adiessl closed 3 years ago

adiessl commented 3 years ago

We are using the directory option for SCSS compilation. The documentation mentions that files in four directories get excluded from the compilation by default in this case, see here: https://github.com/johan-v-r/LibSassBuilder/blob/main/README.md#directory-command-default

That is unfortunately not the whole truth as we had to discover. We observed that some SCSS files in our solution were not compiled while others were. Digging through the source code revealed the reason for this behavior:

https://github.com/johan-v-r/LibSassBuilder/blob/bb0bc8c4d5007098068f2d53e60ade7c89906be6/src/LibSassBuilder/Program.cs#L72

The exclusion check does not take into account the whole folder name, instead it tests if it ends with one of the excluded folder names. In our case the SCSS files were in a folder named Dialogs (ending with logs) and therefore were excluded from the compilation process.

I don't know if testing with EndsWith is the desired behavior, but I think one of the following two options should be implemented:

  1. Update the README.md to point out this behavior.
  2. Replace EndsWith to take the whole directory name into account.
johan-v-r commented 3 years ago

Definitely not the desired behavior, thanks for pointing it out! Will be fixed with next release fairly soon.

johan-v-r commented 3 years ago

Fixed by @deanwiseman with v1.6.3 👍