MSBuild.CompactJsonResources
1.0.1
See the version list below for details.
dotnet add package MSBuild.CompactJsonResources --version 1.0.1
NuGet\Install-Package MSBuild.CompactJsonResources -Version 1.0.1
<PackageReference Include="MSBuild.CompactJsonResources" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add MSBuild.CompactJsonResources --version 1.0.1
#r "nuget: MSBuild.CompactJsonResources, 1.0.1"
// Install MSBuild.CompactJsonResources as a Cake Addin #addin nuget:?package=MSBuild.CompactJsonResources&version=1.0.1 // Install MSBuild.CompactJsonResources as a Cake Tool #tool nuget:?package=MSBuild.CompactJsonResources&version=1.0.1
MSBuild.CompactJsonResources
Often, Json files are added to a project as one line to reduce the size of the build. Such files are uncomfortable to read and track changes through version control systems. This package resolve this problem by removing whitespaces, trailing commas and comments from the builds without changing the beautiful Json source files by adding their single-line copies. It also checks Json files before building and warns about missing curly brace and etc.
{
"null": null, //this is comment
"number": 123,
"object": {
"a": "b",
"c": "d",
},
"string": "Hello World",
}
{"null":null,"number":123,"object":{"a":"b","c":"d"},"string":"Hello World"}
Getting started
- Add reference for this package.
- Set
EnableCompactJson
property totrue
. (When the value isfalse
the files data are not changed) - Just use
JsonEmbeddedResource
asEmbeddedResource
.
<PropertyGroup>
<EnableCompactJson>true</EnableCompactJson>
</PropertyGroup>
<ItemGroup>
<JsonEmbeddedResource Include="data.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSBuild.CompactJsonResources" Version="1.0.0" PrivateAssets="all"/>
</ItemGroup>
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.2 | 508 | 1/21/2022 |
1.0.2-preview2 | 257 | 1/21/2022 |
1.0.2-preview | 249 | 12/19/2021 |
1.0.1 | 493 | 10/23/2021 |
1.0.1-preview1 | 262 | 10/21/2021 |
1.0.0 | 332 | 9/7/2021 |
1.0.0-preview2 | 251 | 8/27/2021 |
1.0.0-preview1 | 203 | 8/25/2021 |