{"id":40681,"library":"builder-html-minifier","title":"builder-html-minifier","description":"HTML minifier plugin for component-builder2.js. Version 1.0.0 is the current stable release, last updated in 2014. This package integrates html-minifier into the component-builder2 build pipeline to minify HTML templates. It requires component-builder2 as a peer dependency and wraps html-minifier. Key differentiator: designed specifically for the component-builder2 ecosystem, but has no default options — minification only occurs if options are passed.","status":"deprecated","version":"1.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/component/builder-html-minifier","tags":["javascript"],"install":[{"cmd":"npm install builder-html-minifier","lang":"bash","label":"npm"},{"cmd":"yarn add builder-html-minifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add builder-html-minifier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency — the plugin is designed to work within component-builder2's build pipeline","package":"component-builder2","optional":false}],"imports":[{"note":"CommonJS only — no ESM support. Package exports a single function.","wrong":"var minifier = require('builder-html-minifier').default;","symbol":"default export","correct":"var minifier = require('builder-html-minifier');"},{"note":"If using ESM, the default import works as the module has a default export. However, the package is CJS only, so this import may cause issues in pure ESM environments.","wrong":"import { minifier } from 'builder-html-minifier';","symbol":"require with alternative styles","correct":"import minifier from 'builder-html-minifier';"},{"note":"Accessing a property 'minifier' from the required module is incorrect — the module exports the function directly.","wrong":"const minifier = require('builder-html-minifier').minifier;","symbol":"dynamic require","correct":"const minifier = require('builder-html-minifier');"}],"quickstart":{"code":"var build = require('component-builder2');\nvar minifier = require('builder-html-minifier');\n\nvar options = {\n  collapseWhitespace: true,\n  collapseBooleanAttributes: true,\n  removeEmptyAttributes: true,\n  removeOptionalTags: true\n};\n\nbuild.scripts(branches, options)\n  .use('templates',\n    build.plugins.string(),\n    minifier(options))\n  .pipe(process.stdout);","lang":"javascript","description":"Sets up component-builder2 to minify HTML templates with recommended options."},"warnings":[{"fix":"Always pass at least the recommended minifierOptions object to the minifier function.","message":"No default options — if you don't pass any options, no minification occurs.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using a modern build tool like webpack with html-loader or html-minifier directly.","message":"Package is effectively deprecated — no updates since 2014, component-builder2 is also unmaintained.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure component-builder2 is installed and required before using this plugin.","message":"Requires component-builder2 as a peer dependency; using without it will cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':11 '2014':20 'build':32 'builder':2 'builder-html-minifi':1 'builder2':31,42,60 'compon':30,41,59 'component-builder2':29,40,58 'component-builder2.js':9 'current':14 'default':65 'depend':46 'design':54 'differenti':53 'ecosystem':61 'html':3,5,25,36,50 'html-minifi':24,49 'integr':23 'javascript':74 'key':52 'last':17 'minif':67 'minifi':4,6,26,35,51 'occur':69 'option':66,71 'packag':22 'pass':73 'peer':45 'pipelin':33 'plugin':7 'releas':16 'requir':39 'specif':55 'stabl':15 'templat':37 'updat':18 'version':10 'wrap':48","created_at":"2026-06-04T18:48:44.526592+00:00","updated_at":"2026-06-04T18:48:44.526592+00:00","problems":[{"fix":"Run 'npm install component-builder2'.","cause":"Missing peer dependency component-builder2.","error":"Error: Cannot find module 'component-builder2'"},{"fix":"Use 'var minifier = require('builder-html-minifier');' without destructuring.","cause":"Incorrect import — may have used a named import instead of default.","error":"TypeError: minifier is not a function"},{"fix":"Ensure you call 'require('component-builder2')' and pass the correct 'branches' and 'options' to build.scripts().","cause":"build object not correctly initialized from component-builder2.","error":"UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'scripts' of undefined"}],"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/component/builder-html-minifier","github":"git://github.com/component/builder-html-minifier","docs":null,"changelog":null,"pypi":null,"npm":"builder-html-minifier","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}}