Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AspNetCore.SassCompiler/build/AspNetCore.SassCompiler.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<SassCompilerEnableWatcher Condition="'$(SassCompilerEnableWatcher)' == '' AND '$(Configuration)' == 'Release'">false</SassCompilerEnableWatcher>
<SassCompilerEnableWatcher Condition="'$(SassCompilerEnableWatcher)' == '' AND '$(OutputType)' == 'Library'">false</SassCompilerEnableWatcher>

<SassCompilerEnableBuildTask Condition="'$(SassCompilerEnableBuildTask)' == ''">true</SassCompilerEnableBuildTask>

<SassCompilerConfiguration Condition="'$(SassCompilerConfiguration)' == ''">$(Configuration)</SassCompilerConfiguration>
<SassCompilerConfiguration Condition="'$(SassCompilerConfiguration)' == ''">Debug</SassCompilerConfiguration>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<Target Name="Compile Sass"
BeforeTargets="Build;ResolveScopedCssInputs;BundleMinify;ResolveProjectStaticWebAssets"
Condition="'$(DesignTimeBuild)' != 'true'">
Condition="'$(DesignTimeBuild)' != 'true' AND '$(SassCompilerEnableBuildTask)' != 'false'">
<CompileSass AppsettingsFile="$(SassCompilerAppsettingsJson)"
SassCompilerFile="$(SassCompilerSassCompilerJson)"
Command="$(SassCompilerBuildCommand)"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ have the `ISassCompiler` available, you can use the `AddSassCompilerCore()` meth
method on the `IServiceCollection`. This will register what is required to use the `ISassCompiler` interface without
registering the hosted service.

If you are only using `ISassCompiler` at runtime and want to disable the MSBuild compile-on-build task entirely, you can
add the following property to your `.csproj` file:

```xml
<PropertyGroup>
<SassCompilerEnableBuildTask>false</SassCompilerEnableBuildTask>
</PropertyGroup>
```

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
Expand Down
Loading