Alethic.AspNet.Optimization.Rollup
0.0.1-pre.12
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
<PackageReference Include="Alethic.AspNet.Optimization.Rollup" Version="0.0.1-pre.12" />
<PackageVersion Include="Alethic.AspNet.Optimization.Rollup" Version="0.0.1-pre.12" />
<PackageReference Include="Alethic.AspNet.Optimization.Rollup" />
paket add Alethic.AspNet.Optimization.Rollup --version 0.0.1-pre.12
#r "nuget: Alethic.AspNet.Optimization.Rollup, 0.0.1-pre.12"
#:package Alethic.AspNet.Optimization.Rollup@0.0.1-pre.12
#addin nuget:?package=Alethic.AspNet.Optimization.Rollup&version=0.0.1-pre.12&prerelease
#tool nuget:?package=Alethic.AspNet.Optimization.Rollup&version=0.0.1-pre.12&prerelease
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
RollupScriptBundlejoins its files in order into one scope, so a top-levelvarorfunctionin 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,
.minswapping, ordering, item transforms and CDN paths all work as for any bundle. Files are read through the bundle'sBundleFiles and the site's virtual path provider. A bundle'sTransformsstart 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-x64from the web project. - The application's Node engines come from
Alethic.Node.AspNet, whosealethic.nodesection inweb.configconfigures 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Alethic.Node.AspNet (>= 1.0.0-pre.37)
- Microsoft.AspNet.Web.Optimization (>= 1.1.3)
- System.Text.Json (>= 10.0.12)
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 |