1.4.4 • Published 10 months ago

astro-htmlnano v1.4.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

Minify Astro files with HTMLNano and CSSNano

Install

npm install --save astro-htmlnano

Usage

getAstroHTMLNano (function)

Minify Astro files with HTMLNano and CSSNano in the production mode

Parameters:

  • options (HtmlnanoOptions) - The HTMLNano options to use when transforming the HTML files
  • preset (HtmlnanoPreset) - The HTMLNano preset to use

returns: (_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext) => Promise

Create ./src/middleware.ts with the following content:

import { getAstroHTMLNano } from "astro-htmlnano"

export const onRequest = getAstroHTMLNano()

Note: this is only enabled when process.env.NODE_ENV === "production"

🤝 Contributing

You can sponsor my work here:

https://github.com/sponsors/aminya

Pull requests, issues and feature requests are welcome. See the Contributing guide.

1.4.4

10 months ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago