johan-v-r / LibSassBuilder

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

Include all *.razor.scss files, exclude specific others (app.razor.scss and all sass\*.scss files) #22

Closed mormarijn closed 2 years ago

mormarijn commented 3 years ago

Hi.

I would like to include all .razor.scss (under Pages and Shared) files to result in a .css file, and I want to exclude app.razor.scss and all .scss files in my sass folder.

image

My config is now as follows:

`

`

However, this also results in an app.razor.css and sass\*.css files. If I delete corresponding generated css files and run again, nothing gets generated until I update one of those excluded .scss files, and css files will be generated again which I do not want (explicitly stated to exclude).

Any idea how I have to setup my SassFile Include and Exclude filter in order to include all *.razor.scss files but exclude app.razor.scss and all .scss files in my sass folder?

I am looking forward to hearing from you soon. Thanks in advance and keep up the good work.

johan-v-r commented 3 years ago

Hi there - have you also disabled the default files?

<PropertyGroup>
  <!-- take full-control -->
  <EnableDefaultSassItems>false</EnableDefaultSassItems>  
</PropertyGroup>
johan-v-r commented 3 years ago

Just another thought here... If you never want those files to compile to *.css (kinda like variable files) you could prefix them with an underscore. **/_* files are already excluded by default

mormarijn commented 3 years ago
<PropertyGroup>
  <!-- take full-control -->
  <EnableDefaultSassItems>false</EnableDefaultSassItems>  
</PropertyGroup>

Ah, that did the track, only thing with this is that those excluded *.scss files disappear from my cs proj (hidden so to say). Is that the way it's supposed to work?

Thanks for your help!

johan-v-r commented 2 years ago

Perhaps the file path or some config in your .csproj file? Can you post your .csproj config or create a repro project?

JelleHissink commented 2 years ago

I find it a bit scary to use BuildingInsideVisualStudio, as this might result in a different build experience inside of VS and on the commandline. VS uses the includes to build the project view, but also runs msbuild within its context. So if you would use BuildingInsideVisualStudio I think the build would also include those items.

johan-v-r commented 2 years ago

Thanks for the feedback! I've left comments on the PR #28 I'm gonna try to test & complete it this weekend, so any further suggestions/concerns please share on the PR.

johan-v-r commented 2 years ago

@mormarijn v1.6.4 should solve the hidden files issue.