{"id":40593,"library":"astro-html-minifier-next","title":"astro-html-minifier-next","description":"Astro integration using html-minifier-next to minify HTML output during build. Version 4.0.2, requires Astro ^6.0.0 and Node >=22.13.0. Unlike other Astro HTML minifiers, it offers full configurability of html-minifier-next options and uses Lightning CSS for speed. Released under MIT license.","status":"active","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/jonasgeiler/astro-html-minifier-next","tags":["javascript","astro","astro-integration","html-minifier","html-minifier-next","html-minifier-terser","minifier","optimization","perf"],"install":[{"cmd":"npm install astro-html-minifier-next","lang":"bash","label":"npm"},{"cmd":"yarn add astro-html-minifier-next","lang":"bash","label":"yarn"},{"cmd":"pnpm add astro-html-minifier-next","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; integration requires Astro v6+.","package":"astro","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require() will fail.","wrong":"const htmlMinifier = require('astro-html-minifier-next');","symbol":"htmlMinifier","correct":"import htmlMinifier from 'astro-html-minifier-next'"},{"note":"htmlMinifier is a default export, not a named export.","wrong":"import { htmlMinifier } from 'astro-html-minifier-next'","symbol":"default export","correct":"import htmlMinifier from 'astro-html-minifier-next'"},{"note":"InlineConfig is a TypeScript type export, not a value.","wrong":"import InlineConfig from 'astro-html-minifier-next'","symbol":"InlineConfig type","correct":"import type { InlineConfig } from 'astro-html-minifier-next'"}],"quickstart":{"code":"import { defineConfig } from 'astro/config';\nimport htmlMinifier from 'astro-html-minifier-next';\n\nexport default defineConfig({\n  integrations: [\n    htmlMinifier({\n      collapseWhitespace: true,\n      removeComments: true,\n      minifyCSS: true,\n      minifyJS: true\n    })\n  ]\n});","lang":"typescript","description":"Configures Astro to minify HTML with recommended html-minifier-next options."},"warnings":[{"fix":"Upgrade Astro to ^6.0.0.","message":"Astro v6 is required; v4.x or v5.x not supported.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Update Node.js to >=22.13.0.","message":"Node.js 22.13.0 or higher required.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Add to integrations as shown in quickstart.","message":"Integration must be added to `integrations` array; placing it elsewhere will not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Refer to html-minifier-next documentation for valid options.","message":"html-minifier-next options are passed directly; invalid options may be ignored or cause errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'22.13.0':26 '4.0.2':20 '6.0.0':23 'astro':2,6,22,29,53,55 'astro-html-minifier-next':1 'astro-integr':54 'build':18 'configur':35 'css':45 'full':34 'html':3,10,15,30,38,58,61,65 'html-minifi':57 'html-minifier-next':9,37,60 'html-minifier-ters':64 'integr':7,56 'javascript':52 'licens':51 'lightn':44 'minifi':4,11,14,31,39,59,62,66,68 'mit':50 'next':5,12,40,63 'node':25 'offer':33 'optim':69 'option':41 'output':16 'perf':70 'releas':48 'requir':21 'speed':47 'terser':67 'unlik':27 'use':8,43 'version':19","created_at":"2026-06-04T18:48:18.902296+00:00","updated_at":"2026-06-04T18:48:18.902296+00:00","problems":[{"fix":"Upgrade Astro to ^6.0.0.","cause":"Using Astro <6.0.0.","error":"Error: The integration 'astro-html-minifier-next' is not compatible with this version of Astro."},{"fix":"Use `import htmlMinifier from 'astro-html-minifier-next'` (default import).","cause":"Using a named import instead of default import.","error":"TypeError: htmlMinifier is not a function"},{"fix":"Switch to ESM imports (import statement) or use dynamic import().","cause":"Using CommonJS require() on an ESM-only package.","error":"require() of ES Module /.../node_modules/astro-html-minifier-next/index.js not supported."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jonasgeiler/astro-html-minifier-next#readme","github":"https://github.com/jonasgeiler/astro-html-minifier-next","docs":null,"changelog":null,"pypi":null,"npm":"astro-html-minifier-next","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}