From a6c318cb5e614d7cbea5161601b7ca8175b19f5f Mon Sep 17 00:00:00 2001 From: Stephan van Leeuwen Date: Wed, 6 May 2026 18:47:15 +0200 Subject: [PATCH] Allow disabling the sass compile on build task via a MSBuild property Fixes #246 --- .../build/AspNetCore.SassCompiler.props | 2 ++ .../build/AspNetCore.SassCompiler.targets | 2 +- README.md | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.props b/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.props index 0ed6dba..4057738 100644 --- a/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.props +++ b/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.props @@ -29,6 +29,8 @@ false false + true + $(Configuration) Debug diff --git a/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.targets b/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.targets index 86b04aa..90d8d62 100644 --- a/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.targets +++ b/AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.targets @@ -14,7 +14,7 @@ + Condition="'$(DesignTimeBuild)' != 'true' AND '$(SassCompilerEnableBuildTask)' != 'false'"> + false + +``` + +This prevents the Sass MSBuild task from running during `build` and `publish`, while leaving `ISassCompiler` fully functional at runtime. + ## Publish This library also includes an MSBuild task that runs during the publish of your application. Because of this you don't need to include