Alethic.AspNet.Optimization.Rollup 0.0.1-pre.12

This is a prerelease version of Alethic.AspNet.Optimization.Rollup.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Alethic.AspNet.Optimization.Rollup --version 0.0.1-pre.12
                    
NuGet\Install-Package Alethic.AspNet.Optimization.Rollup -Version 0.0.1-pre.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alethic.AspNet.Optimization.Rollup" Version="0.0.1-pre.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alethic.AspNet.Optimization.Rollup" Version="0.0.1-pre.12" />
                    
Directory.Packages.props
<PackageReference Include="Alethic.AspNet.Optimization.Rollup" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alethic.AspNet.Optimization.Rollup --version 0.0.1-pre.12
                    
#r "nuget: Alethic.AspNet.Optimization.Rollup, 0.0.1-pre.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alethic.AspNet.Optimization.Rollup@0.0.1-pre.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alethic.AspNet.Optimization.Rollup&version=0.0.1-pre.12&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Alethic.AspNet.Optimization.Rollup&version=0.0.1-pre.12&prerelease
                    
Install as a Cake Tool

Alethic.AspNet.Optimization.Rollup

System.Web.Optimization bundles built by a real JavaScript toolchain: Rollup orchestrating Sass, SWC, Terser and Lightning CSS, running in the site's own Node engines through Alethic.Node. For ASP.NET on .NET Framework, Web Forms and MVC alike.

using Alethic.AspNet.Optimization.Rollup;

public static void RegisterBundles(BundleCollection bundles)
{
    // classic scripts, in the order they run: one global scope, as if each file had its own <script> tag
    bundles.Add(new RollupScriptBundle("~/bundle/cart.js")
        .Include("~/scripts/currency.js")
        .Include("~/scripts/cart.ts"));

    // ES modules from their entry: imports followed and tree-shaken, bundled into one immediately invoked function
    bundles.Add(new RollupModuleBundle("~/bundle/app.js", "~/scripts/app/main.ts"));

    // a stylesheet from its entry: Sass compiled, then transformed and minified by Lightning CSS
    bundles.Add(new RollupStyleBundle("~/bundle/site.css", "~/styles/site.scss"));
}

Scripts.Render and Styles.Render render them as they render any bundle.

What it does

  • Every bundle is one Rollup build. Rollup reads the bundle's files, runs each through its transform plugins, and renders the output.
    • TypeScript has its types stripped by SWC. Type checking stays with the compiler, in the editor and the build.
    • Scripts and modules are minified by Terser.
    • Stylesheets are compiled by Sass, then transformed and minified by Lightning CSS.
  • Classic scripts stay classic. A RollupScriptBundle joins its files in order into one scope, so a top-level var or function in one file is a global the next can use, exactly as when the files are joined as text.
  • Every file the build read keeps the bundle current. An edit to any of them, imported modules and Sass partials included, rebuilds the bundle on its next request. This needs no file change notifications, which a site running Node turns off.
  • It is System.Web.Optimization underneath. Rendering, versioned URLs, caching, ignore lists, .min swapping, ordering, item transforms and CDN paths all work as for any bundle. Files are read through the bundle's BundleFiles and the site's virtual path provider. A bundle's Transforms start empty, for the site's own, which run on the built content.
  • Source maps. Set SourceMap = true, or leave it to follow optimizations, to append an inline source map that shows the browser's tools each file as it was written, TypeScript and Sass included.

Where optimizations are disabled, System.Web.Optimization renders a bundle as a tag per file. TypeScript and Sass files cannot yet be served on their own, so a bundle that includes them needs optimizations enabled.

Requirements

  • .NET Framework 4.8, 64-bit.
  • libnode: reference Microsoft.JavaScript.LibNode.win-x64 from the web project.
  • The application's Node engines come from Alethic.Node.AspNet, whose alethic.node section in web.config configures them.
  • Node starts once per process, and ASP.NET restarts an application in a new AppDomain of the same process. Keep it from doing so, for example with <httpRuntime fcnMode="Disabled" />, and recycle the application pool instead. See Alethic.Node.AspNet.
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0 99 10/3/2026
0.0.1-pre.14 71 10/3/2026
0.0.1-pre.12 67 10/3/2026