zorgoz.PreCompress 0.9.5

dotnet tool install --global zorgoz.PreCompress --version 0.9.5
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local zorgoz.PreCompress --version 0.9.5
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=zorgoz.PreCompress&version=0.9.5
nuke :add-package zorgoz.PreCompress --version 0.9.5

PreCompress

Simple tool to create pre-compressed version for static content files to be served by Kestler or IIS with ASP.NET Core. The need arose from an issue with publishing, where the pre-compressed files had different (older) content as the non-compressed versions. This tool is intended to be used as a post-publish step to create the compressed files.

Usage

Options:

-i, --input <i> (REQUIRED)  The file to compress. [] 
-nb, --NoBrotli             Omit Brotli compressed version. [default: False] 
-ng, --NoGzip               Omit GZip compressed version. [default: False]         
-p, --pattern <p>           The regex pattern to use for files in a folder. [default: *.]
-d, --destination <d>       The output directory.

The input parameter can be multiple. Each can be a single file, a folder or a simple search patterm. If can be both absolute and relative, even mixed for the different parameter instances.

By default it will create both GZip and Brotli compressed versions of the file.

Destination directory should exist if specified.

Examples:

PreCompress -i C:\temp\source\*.dll -d c:\temp\destination
PreCompress -i C:\temp\source\*.dll -i C:\temp\source\*.json
PreCompress -i C:\temp\source\ -p *\.(dll|js.*)$
PreCompress -i source\file.dll
PreCompress -i *.dll

Installation

The tool is available as a dotnet global or local tool. To install it follow the instructions on nuget: https://www.nuget.org/packages/zorgoz.PreCompress/

Install as global tool with

dotnet tool install --global zorgoz.PreCompress`

or as local tool with (be aware to install in the correct path)

dotnet new tool-manifest
dotnet tool install zorgoz.PreCompress

Usage as a tool

After installing as tool, you can add this to you .csproj file as a post-publish step.

<Target Name="PreCompress" AfterTargets="Publish">
	<Exec Command="dotnet tool run precompress -i $(PublishDir)wwwroot\_framework\ -p \.(dll|js|json|wasm|blat)$"></Exec>
</Target>

Planned features

  • Add support for recursive folder search (currently only one level deep), first without destination folder
  • Add support for recursivity with destination folder (copy unmatching parts of the folder structure)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.9.5 215 4/8/2024
0.9.4 227 4/4/2024