excubo-ag / WebCompiler

Apache License 2.0
148 stars 29 forks source link

Override json config via CLI #87

Closed lonix1 closed 6 months ago

lonix1 commented 8 months ago

Assumptions

I'm using this msbuild task:

<Target Name="CompileStaticAssets" AfterTargets="BeforeBuild">
  <Exec Command="dotnet webcompiler --config webcompiler.json --recursive wwwroot" StandardOutputImportance="high" />
  <Exec Command="dotnet webcompiler --config webcompiler.json --recursive Pages --minify disable" StandardOutputImportance="high" />
</Target>

Notice how the second command uses --minify disable to override the default in the config file. I assumed that would work because it's standard practice in .NET (env vars take precendence, then CLI vars, then file config, then code config).

However, it minifies those files anyway.

Can I override the json config via the CLI?

stefanloerwald commented 8 months ago

This sounds like a reasonable expectation. I will have to look into code for why this is not happening.