dotnet / dotnet/sdk

Exclude css isolation assets from `dotnet publish`

Open
#53,169 1 comment 0 reactions 0 assignees View on GitHub
untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

> Originally posted at [StackOverflow](https://stackoverflow.com/q/72448577/9971404), but there seems no way to control this. So I'm adding as a feature request. Thank you.
>
> ### Is there an existing issue for this?
> * [x] I have searched the existing issues
>
> ### Is your feature request related to a problem? Please describe the problem.
> I'm using RazorPages (on ASP.NET Core 6) and "css isolation". The css files are generated at `obj/{Debug,Release}/net6.0/scopedcss/Pages/`, and are included when performing a `dotnet publish`.
>
> I also use Webpack, so I don't need to publish those css files (they are already bundled by Webpack).
>
> I added variations of all of these to my `Project.csproj` without success:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> $(DefaultItemExcludes);obj/*/*/scopedcss/**/*
>
> These (and variations of them in every combination) did not work.
>
> ### Describe the solution you'd like
> Please provide a way to exclude css isolation assets from `dotnet publish`.
>
> ### Additional context
> My non-ideal workaround is to delete the files after publish:
>
>
>
>

Tracking an [issue](https://github.com/dotnet/aspnetcore/issues/41961) created on /aspnetcore, so it can be fixed here in the sdk instead.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.