Dm.Web.BuildStatic 1.1.0

dotnet tool install --global Dm.Web.BuildStatic --version 1.1.0
                    
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 Dm.Web.BuildStatic --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Dm.Web.BuildStatic&version=1.1.0
                    
nuke :add-package Dm.Web.BuildStatic --version 1.1.0
                    

🛠️ .NET Pre-build tool for static resources

Install

Install as a .NET tool:

dotnet tool install --global Dm.Web.BuildStatic

Usage

CLI:

Dm.Web.BuildStatic [config.json]

# OR

Dm.Web.BuildStatic # Uses dm.web.build.static.json config by default

Pre-build step:

<Target Name="BuildStatic" BeforeTargets="PreBuildEvent">
	

	
	<Exec Command="Dm.Web.BuildStatic" />

	
	<Exec Command="Dm.Web.BuildStatic PreBuild/config.json" />
</Target>

Config format

{
    "parallel": true,
    "use": {
        "list":     "Dm.Web.BuildStatic.Stages.Files.FilesSource",
        "eachFile": "Dm.Web.BuildStatic.Stages.Files.EachFileCopy",
        "minjs":    "Dm.Web.BuildStatic.Stages.JS.MinifyJS",
        "gzip":     "Dm.Web.BuildStatic.Stages.Compress.GzipStream",
		"sprite":   "Dm.Web.BuildStatic.Stages.SVG.SVGSprite",
        "svg2mjs":  "Dm.Web.BuildStatic.Stages.SVG.SVGtoJS"
    },
    "pipelines": [
        {
            "list":  "TestStatic/js/**/*.js",
            "list":  "TestStatic/js/**/*.mjs",
            "eachFile": {
                "@dst":  "{path}.gz",
                "gzip":  "Optimal",
                "minjs": null
            }
        },
        {
            "list": "TestStatic/css/*.css",
            "eachFile": {
                "@dst": "{path}.gz",
                "gzip": null
            }
        },
        {
            "list":  "TestStatic/move-to-js.txt",
            "eachFile":  {
                "@dst":  "TestStatic/js/moved.js.gz",
                "gzip":  null,
                "minjs": null
            }
        },
        {
            "list":   "TestStatic/img/oauth2-icons/*.svg",
			"sprite": "TestStatic/img/oauth2-icons.mjs.gz",
			"gzip":    null,
            "svg2mjs": null
        }
    ]
}

The configuration has two main sections:

  1. use: Defines available steps in format: "step_name": "ClassName"
  2. pipelines: Defines pipelines and their steps in format: "step_name": <config_data>|null

Optional parameter:

  1. parallel: Run the pipelines in parallel or sequentially.

Built-in Pipeline Stages

  1. Dm.Web.BuildStatic.Stages.Files.FilesSource - enumerates files in a folder. Requires a "folder+pattern" parameter (e.g., "js/*.js" for all JS files in the js folder, "js/**/*.js" for JS files in the js folder and its subfolders).
  2. Dm.Web.BuildStatic.Stages.Files.EachFileCopy - copies a files from src collection (provided by the previous stage) to @dst (required parameter).
  3. Dm.Web.BuildStatic.Stages.Files.FileCopy - copies a one file from src (provided by the previous stage) to @dst (required parameter).
  4. Dm.Web.BuildStatic.Stages.JS.MinifyJS - minifies a JS file using Uglify. Accepts an InOutStreams model with source JS and outputs InOutStreams with minified JS in InOutStreams.In. If this is the final stage, saves the minified content to InOutStreams.Out.
  5. Dm.Web.BuildStatic.Stages.Compress.GzipStream - compresses the incoming InOutStreams.In stream to InOutStreams.Out using GZIP.
  6. Dm.Web.BuildStatic.Stages.SVG.SVGSprite - combines an incoming collection of SVG symbol files into a sprite. Requires a dst parameter (output destination).
  7. Dm.Web.BuildStatic.Stages.SVG.SVGtoJS - build a JS module file for add SVG to document.head. Accepts an InOutStreams model with source SVG and outputs InOutStreams with ready JS in InOutStreams.In. If this is the final stage, saves the JS to InOutStreams.Out.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
1.1.0 52 11/19/2026
1.0.4 147 8/15/2026
1.0.3 268 11/24/2025
1.0.2 226 10/13/2025
1.0.1 238 10/8/2025
1.0.0 228 10/8/2025