{"library":"minify-html-webpack-plugin","title":"Minify HTML Webpack Plugin","description":"A webpack plugin that minifies HTML files using html-minifier after the webpack build. Version 1.1.7 supports webpack 2-5 and Node >= 6.0. It iterates through source directories recursively, copying and minifying all HTML files. Key features include search-and-replace before minification and an afterBuild option to run after webpack completes. The plugin is mainly used in PHP/Laravel projects to minify Blade-compiled views. Released sporadically, last update in 2021.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install minify-html-webpack-plugin"],"cli":null},"imports":["const MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');","const MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');","new MinifyHtmlWebpackPlugin({ src: '...', dest: '...' })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\nconst MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new MinifyHtmlWebpackPlugin({\n      src: path.resolve(__dirname, 'src/html'),\n      dest: path.resolve(__dirname, 'dist/html'),\n      rules: {\n        collapseBooleanAttributes: true,\n        collapseWhitespace: true,\n        removeAttributeQuotes: true,\n        removeComments: true,\n        minifyJS: true,\n        minifyCSS: true\n      }\n    })\n  ]\n};","lang":"javascript","description":"Basic config to minify HTML files from src/html to dist/html after webpack build.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}