{"id":41255,"library":"html-remove-whitespace-plugin","title":"HtmlRemoveWhitespacePlugin","description":"A Webpack plugin that removes whitespace and comments from HTML files, specifically designed for Velocity template files where html-minifier fails. It strips HTML comments, inline JS/CSS comments, and replaces multiple spaces with single spaces. Version 0.0.3 is the current stable release, with no recent updates. It integrates with html-webpack-plugin and offers optional exclude/include patterns via regex.","status":"abandoned","version":"0.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/liberalist1991/html-remove-whitespace-plugin","tags":["javascript","Webpack","js","minify","remove"],"install":[{"cmd":"npm install html-remove-whitespace-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add html-remove-whitespace-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add html-remove-whitespace-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not export ESM; use CommonJS require.","wrong":"import HtmlRemoveWhitespacePlugin from 'html-remove-whitespace-plugin';","symbol":"HtmlRemoveWhitespacePlugin","correct":"const HtmlRemoveWhitespacePlugin = require('html-remove-whitespace-plugin');"}],"quickstart":{"code":"const HtmlWebpackPlugin = require('html-webpack-plugin');\nconst HtmlRemoveWhitespacePlugin = require('html-remove-whitespace-plugin');\n\nmodule.exports = {\n  plugins: [\n    new HtmlWebpackPlugin({\n      template: 'index.html'\n    }),\n    new HtmlRemoveWhitespacePlugin()\n  ]\n};","lang":"javascript","description":"Shows how to add HtmlRemoveWhitespacePlugin to a Webpack config with html-webpack-plugin."},"warnings":[{"fix":"Ensure no HTML-like comments exist in inline scripts, or use exclude option.","message":"Plugin may break JavaScript strings containing '<!--' or similar patterns","severity":"gotcha","affected_versions":"*"},{"fix":"Use require() instead of import.","message":"No support for ESM imports; only CommonJS require works","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.0.3':39 'comment':9,27,30 'current':42 'design':14 'exclude/include':59 'fail':23 'file':12,18 'html':11,21,26,53 'html-minifi':20 'html-webpack-plugin':52 'htmlremovewhitespaceplugin':1 'inlin':28 'integr':50 'javascript':63 'js':65 'js/css':29 'minifi':22,66 'multipl':33 'offer':57 'option':58 'pattern':60 'plugin':4,55 'recent':47 'regex':62 'releas':44 'remov':6,67 'replac':32 'singl':36 'space':34,37 'specif':13 'stabl':43 'strip':25 'templat':17 'updat':48 'veloc':16 'version':38 'via':61 'webpack':3,54,64 'whitespac':7","created_at":"2026-06-04T18:51:31.610947+00:00","updated_at":"2026-06-04T18:51:31.610947+00:00","problems":[{"fix":"Run npm install html-remove-whitespace-plugin --save-dev","cause":"Package not installed or misspelled","error":"Cannot find module 'html-remove-whitespace-plugin'"},{"fix":"Use const HtmlRemoveWhitespacePlugin = require('html-remove-whitespace-plugin');","cause":"Using ESM import style (import ... from) instead of require","error":"TypeError: HtmlRemoveWhitespacePlugin is not a constructor"}],"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/liberalist1991/html-remove-whitespace-plugin#readme","github":"https://github.com/liberalist1991/html-remove-whitespace-plugin","docs":null,"changelog":null,"pypi":null,"npm":"html-remove-whitespace-plugin","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}}