├── .gitignore ├── README.md ├── index.js ├── manifest.yml ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .netlify 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Netlify Plugin - Minify HTML 2 | 3 | This [plugin](https://www.netlify.com/build/plugins-beta?utm_source=github&utm_medium=plugin-htmlminifier-pnh&utm_campaign=devex) adds the ability to minify the HTML generated by your build. 4 | 5 | Note: Many SSGs support this as part of their own process so this might not always be necessary. 6 | 7 | This plugin is agnostic to the tool being used to generate the markup, and acts purely on the markup it finds in `.html` files in the publish folder which [Netlify](https://www.netlify.com?utm_source=github&utm_medium=plugin-htmlminifier-pnh&utm_campaign=devex) is preparing to deploy to [its CDN](https://www.netlify.com/products/edge/?utm_source=github&utm_medium=pluginhtmlminifier-pnh&utm_campaign=devex) following a successful build. 8 | 9 | ## Installation 10 | 11 | To include this plugin in your site deployment, use the Netlify UI or file-based installation: 12 | 13 | ### UI installation 14 | 15 | You can install this plugin in the Netlify UI from this [direct in-app installation link](https://app.netlify.com/plugins/netlify-plugin-minify-html/install) or from the [Plugins directory](https://app.netlify.com/plugins). 16 | 17 | ### File-based installation 18 | 19 | #### 1. Add the plugin as a dependency 20 | 21 | ```bash 22 | 23 | # Add the plugin as a dependency of your build 24 | npm i -D netlify-plugin-minify-html 25 | 26 | ``` 27 | 28 | 29 | #### 2. Add the plugin and its options to your netlify.toml 30 | 31 | You can choose which [deploy contexts](https://docs.netlify.com/site-deploys/overview/?utm_source=github&utm_medium=plugin-htmlminfier-pnh&utm_campaign=devex#deploy-contexts) will include the HTML minification with the `targets` option. 32 | 33 | You can use the default options for the minification or use `[plugins.inputs.minifierOptions]` to pass options to the minifier. A full list of the [available options](https://www.npmjs.com/package/html-minifier#options-quick-reference) are available from the [html-minfier library](https://www.npmjs.com/package/html-minifier) 34 | 35 | ```toml 36 | 37 | # Config for the Netlify Build Plugin: netlify-plugin-minify-html 38 | [[plugins]] 39 | package = "netlify-plugin-minify-html" 40 | 41 | # Specify which deploy contexts we'll minify HTML in. 42 | # Supports any Deploy Contexts available in Netlify. 43 | # https://docs.netlify.com/site-deploys/overview/#deploy-contexts 44 | [plugins.inputs] 45 | contexts = [ 46 | 'production', 47 | 'branch-deploy', 48 | 'deploy-preview' 49 | ] 50 | 51 | # Optionally, override the default options for the minification 52 | # https://github.com/kangax/html-minifier#options-quick-reference 53 | [plugins.inputs.minifierOptions] 54 | removeComments = false 55 | collapseInlineTagWhitespace = false 56 | 57 | ``` 58 | 59 | ## Quick try-out 60 | 61 | You can try out this plugin by deploying [a simple site](https://test-plugin-html-minifer.netlify.app/) which uses it. 62 | 63 | Clicking the button below will clone [a test site repo](https://github.com/philhawksworth/test-site-netlify-plugin-minify-html), setup a new site [on Netlify](https://netlify.com?utm_source=github&utm_medium=plugin-htmlminifier-pnh&utm_campaign=devex) and deploy the site complete with the plugin configured and operational. 64 | 65 | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/philhawksworth/test-site-netlify-plugin-minify-html&utm_source=github&utm_medium=plugin-htmlminifier-pnh&utm_campaign=devex) 66 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const comp = require('@node-minify/core'); 2 | const htmlMinifier = require('@node-minify/html-minifier'); 3 | 4 | 5 | module.exports = { 6 | 7 | onPostBuild: async ({ inputs, constants, utils }) => { 8 | 9 | // Only continue in the selected deploy contexts 10 | if( !inputs.contexts.includes(process.env.CONTEXT) ) { 11 | console.log('Not minifiying HTML in the context:', process.env.CONTEXT); 12 | return; 13 | } 14 | 15 | // Minify HTML 16 | console.log('Minifiying HTML in the deploy context:', process.env.CONTEXT); 17 | const options = { 18 | collapseWhitespace: false, 19 | ...inputs.minifierOptions 20 | }; 21 | console.log('Minifiying HTML with these options:', options || "Default"); 22 | 23 | try { 24 | const compResult = await comp({ 25 | compressor: htmlMinifier, 26 | input: constants.PUBLISH_DIR + '/**/*.html', 27 | output: '$1.html', 28 | replaceInPlace: true, 29 | options 30 | }); 31 | console.log('Minifiying HTML complete'); 32 | 33 | } catch (error) { 34 | utils.build.failPlugin('The Minify HTML plugin failed.', { error }) 35 | } 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /manifest.yml: -------------------------------------------------------------------------------- 1 | name: netlify-plugin-minify-html 2 | inputs: 3 | - name: contexts 4 | default: 5 | - production 6 | - branch-deploy 7 | - deploy-preview 8 | - name: minifierOptions 9 | required: false 10 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netlify-plugin-minify-html", 3 | "version": "0.3.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "netlify-plugin-minify-html", 9 | "version": "0.3.1", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@node-minify/core": "^9.0.2", 13 | "@node-minify/html-minifier": "^9.0.1" 14 | } 15 | }, 16 | "node_modules/@isaacs/cliui": { 17 | "version": "8.0.2", 18 | "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", 19 | "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", 20 | "license": "ISC", 21 | "dependencies": { 22 | "string-width": "^5.1.2", 23 | "string-width-cjs": "npm:string-width@^4.2.0", 24 | "strip-ansi": "^7.0.1", 25 | "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", 26 | "wrap-ansi": "^8.1.0", 27 | "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" 28 | }, 29 | "engines": { 30 | "node": ">=12" 31 | } 32 | }, 33 | "node_modules/@node-minify/core": { 34 | "version": "9.0.2", 35 | "resolved": "https://registry.npmjs.org/@node-minify/core/-/core-9.0.2.tgz", 36 | "integrity": "sha512-FNhv29Wom6wKrrFKaeAfmZqz7TX5A1E6P+bpd0VIc+DYWMLUIhAViS8riaZg3A1oD0s06s+5BG2Fg7RqMKiKHw==", 37 | "license": "MIT", 38 | "dependencies": { 39 | "@node-minify/utils": "9.0.1", 40 | "glob": "10.3.3", 41 | "mkdirp": "3.0.1" 42 | }, 43 | "engines": { 44 | "node": ">=18.0.0" 45 | } 46 | }, 47 | "node_modules/@node-minify/html-minifier": { 48 | "version": "9.0.1", 49 | "resolved": "https://registry.npmjs.org/@node-minify/html-minifier/-/html-minifier-9.0.1.tgz", 50 | "integrity": "sha512-LCiL3fx3oHnYLdiKbf9thpMxxQjdyLLDLBr/qIRb1AAPYc2FWxtUXHlzi00WwVvj7YRVauEG96z/t4ZpBz0JDA==", 51 | "license": "MIT", 52 | "dependencies": { 53 | "@node-minify/utils": "9.0.1", 54 | "html-minifier": "4.0.0" 55 | }, 56 | "engines": { 57 | "node": ">=18.0.0" 58 | } 59 | }, 60 | "node_modules/@node-minify/utils": { 61 | "version": "9.0.1", 62 | "resolved": "https://registry.npmjs.org/@node-minify/utils/-/utils-9.0.1.tgz", 63 | "integrity": "sha512-aC1+mhKTP3IMa2VcuGl3ui92LO/7CPQWldNGzu3BVGKiMNJ70AKJW/R6huuYCSuQyHDGM9oFwiVClsZnFxn67g==", 64 | "license": "MIT", 65 | "dependencies": { 66 | "gzip-size": "6.0.0" 67 | }, 68 | "engines": { 69 | "node": ">=18.0.0" 70 | } 71 | }, 72 | "node_modules/@pkgjs/parseargs": { 73 | "version": "0.11.0", 74 | "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", 75 | "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", 76 | "license": "MIT", 77 | "optional": true, 78 | "engines": { 79 | "node": ">=14" 80 | } 81 | }, 82 | "node_modules/ansi-regex": { 83 | "version": "6.1.0", 84 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 85 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 86 | "license": "MIT", 87 | "engines": { 88 | "node": ">=12" 89 | }, 90 | "funding": { 91 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 92 | } 93 | }, 94 | "node_modules/ansi-styles": { 95 | "version": "6.2.1", 96 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 97 | "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 98 | "license": "MIT", 99 | "engines": { 100 | "node": ">=12" 101 | }, 102 | "funding": { 103 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 104 | } 105 | }, 106 | "node_modules/balanced-match": { 107 | "version": "1.0.2", 108 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 109 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 110 | "license": "MIT" 111 | }, 112 | "node_modules/brace-expansion": { 113 | "version": "2.0.1", 114 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 115 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 116 | "license": "MIT", 117 | "dependencies": { 118 | "balanced-match": "^1.0.0" 119 | } 120 | }, 121 | "node_modules/camel-case": { 122 | "version": "3.0.0", 123 | "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", 124 | "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", 125 | "license": "MIT", 126 | "dependencies": { 127 | "no-case": "^2.2.0", 128 | "upper-case": "^1.1.1" 129 | } 130 | }, 131 | "node_modules/clean-css": { 132 | "version": "4.2.4", 133 | "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", 134 | "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", 135 | "license": "MIT", 136 | "dependencies": { 137 | "source-map": "~0.6.0" 138 | }, 139 | "engines": { 140 | "node": ">= 4.0" 141 | } 142 | }, 143 | "node_modules/color-convert": { 144 | "version": "2.0.1", 145 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 146 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 147 | "license": "MIT", 148 | "dependencies": { 149 | "color-name": "~1.1.4" 150 | }, 151 | "engines": { 152 | "node": ">=7.0.0" 153 | } 154 | }, 155 | "node_modules/color-name": { 156 | "version": "1.1.4", 157 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 158 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 159 | "license": "MIT" 160 | }, 161 | "node_modules/commander": { 162 | "version": "2.20.3", 163 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 164 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 165 | "license": "MIT" 166 | }, 167 | "node_modules/cross-spawn": { 168 | "version": "7.0.6", 169 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 170 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 171 | "license": "MIT", 172 | "dependencies": { 173 | "path-key": "^3.1.0", 174 | "shebang-command": "^2.0.0", 175 | "which": "^2.0.1" 176 | }, 177 | "engines": { 178 | "node": ">= 8" 179 | } 180 | }, 181 | "node_modules/duplexer": { 182 | "version": "0.1.2", 183 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", 184 | "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", 185 | "license": "MIT" 186 | }, 187 | "node_modules/eastasianwidth": { 188 | "version": "0.2.0", 189 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 190 | "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", 191 | "license": "MIT" 192 | }, 193 | "node_modules/emoji-regex": { 194 | "version": "9.2.2", 195 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", 196 | "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", 197 | "license": "MIT" 198 | }, 199 | "node_modules/foreground-child": { 200 | "version": "3.3.0", 201 | "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", 202 | "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", 203 | "license": "ISC", 204 | "dependencies": { 205 | "cross-spawn": "^7.0.0", 206 | "signal-exit": "^4.0.1" 207 | }, 208 | "engines": { 209 | "node": ">=14" 210 | }, 211 | "funding": { 212 | "url": "https://github.com/sponsors/isaacs" 213 | } 214 | }, 215 | "node_modules/glob": { 216 | "version": "10.3.3", 217 | "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", 218 | "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", 219 | "license": "ISC", 220 | "dependencies": { 221 | "foreground-child": "^3.1.0", 222 | "jackspeak": "^2.0.3", 223 | "minimatch": "^9.0.1", 224 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", 225 | "path-scurry": "^1.10.1" 226 | }, 227 | "bin": { 228 | "glob": "dist/cjs/src/bin.js" 229 | }, 230 | "engines": { 231 | "node": ">=16 || 14 >=14.17" 232 | }, 233 | "funding": { 234 | "url": "https://github.com/sponsors/isaacs" 235 | } 236 | }, 237 | "node_modules/gzip-size": { 238 | "version": "6.0.0", 239 | "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", 240 | "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", 241 | "license": "MIT", 242 | "dependencies": { 243 | "duplexer": "^0.1.2" 244 | }, 245 | "engines": { 246 | "node": ">=10" 247 | }, 248 | "funding": { 249 | "url": "https://github.com/sponsors/sindresorhus" 250 | } 251 | }, 252 | "node_modules/he": { 253 | "version": "1.2.0", 254 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 255 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 256 | "license": "MIT", 257 | "bin": { 258 | "he": "bin/he" 259 | } 260 | }, 261 | "node_modules/html-minifier": { 262 | "version": "4.0.0", 263 | "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", 264 | "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", 265 | "license": "MIT", 266 | "dependencies": { 267 | "camel-case": "^3.0.0", 268 | "clean-css": "^4.2.1", 269 | "commander": "^2.19.0", 270 | "he": "^1.2.0", 271 | "param-case": "^2.1.1", 272 | "relateurl": "^0.2.7", 273 | "uglify-js": "^3.5.1" 274 | }, 275 | "bin": { 276 | "html-minifier": "cli.js" 277 | }, 278 | "engines": { 279 | "node": ">=6" 280 | } 281 | }, 282 | "node_modules/is-fullwidth-code-point": { 283 | "version": "3.0.0", 284 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 285 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 286 | "license": "MIT", 287 | "engines": { 288 | "node": ">=8" 289 | } 290 | }, 291 | "node_modules/isexe": { 292 | "version": "2.0.0", 293 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 294 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 295 | "license": "ISC" 296 | }, 297 | "node_modules/jackspeak": { 298 | "version": "2.3.6", 299 | "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", 300 | "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", 301 | "license": "BlueOak-1.0.0", 302 | "dependencies": { 303 | "@isaacs/cliui": "^8.0.2" 304 | }, 305 | "engines": { 306 | "node": ">=14" 307 | }, 308 | "funding": { 309 | "url": "https://github.com/sponsors/isaacs" 310 | }, 311 | "optionalDependencies": { 312 | "@pkgjs/parseargs": "^0.11.0" 313 | } 314 | }, 315 | "node_modules/lower-case": { 316 | "version": "1.1.4", 317 | "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", 318 | "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==", 319 | "license": "MIT" 320 | }, 321 | "node_modules/lru-cache": { 322 | "version": "10.4.3", 323 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", 324 | "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", 325 | "license": "ISC" 326 | }, 327 | "node_modules/minimatch": { 328 | "version": "9.0.5", 329 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", 330 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", 331 | "license": "ISC", 332 | "dependencies": { 333 | "brace-expansion": "^2.0.1" 334 | }, 335 | "engines": { 336 | "node": ">=16 || 14 >=14.17" 337 | }, 338 | "funding": { 339 | "url": "https://github.com/sponsors/isaacs" 340 | } 341 | }, 342 | "node_modules/minipass": { 343 | "version": "7.1.2", 344 | "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", 345 | "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", 346 | "license": "ISC", 347 | "engines": { 348 | "node": ">=16 || 14 >=14.17" 349 | } 350 | }, 351 | "node_modules/mkdirp": { 352 | "version": "3.0.1", 353 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", 354 | "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", 355 | "license": "MIT", 356 | "bin": { 357 | "mkdirp": "dist/cjs/src/bin.js" 358 | }, 359 | "engines": { 360 | "node": ">=10" 361 | }, 362 | "funding": { 363 | "url": "https://github.com/sponsors/isaacs" 364 | } 365 | }, 366 | "node_modules/no-case": { 367 | "version": "2.3.2", 368 | "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", 369 | "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", 370 | "license": "MIT", 371 | "dependencies": { 372 | "lower-case": "^1.1.1" 373 | } 374 | }, 375 | "node_modules/param-case": { 376 | "version": "2.1.1", 377 | "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", 378 | "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", 379 | "license": "MIT", 380 | "dependencies": { 381 | "no-case": "^2.2.0" 382 | } 383 | }, 384 | "node_modules/path-key": { 385 | "version": "3.1.1", 386 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 387 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 388 | "license": "MIT", 389 | "engines": { 390 | "node": ">=8" 391 | } 392 | }, 393 | "node_modules/path-scurry": { 394 | "version": "1.11.1", 395 | "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", 396 | "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", 397 | "license": "BlueOak-1.0.0", 398 | "dependencies": { 399 | "lru-cache": "^10.2.0", 400 | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" 401 | }, 402 | "engines": { 403 | "node": ">=16 || 14 >=14.18" 404 | }, 405 | "funding": { 406 | "url": "https://github.com/sponsors/isaacs" 407 | } 408 | }, 409 | "node_modules/relateurl": { 410 | "version": "0.2.7", 411 | "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", 412 | "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", 413 | "license": "MIT", 414 | "engines": { 415 | "node": ">= 0.10" 416 | } 417 | }, 418 | "node_modules/shebang-command": { 419 | "version": "2.0.0", 420 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 421 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 422 | "license": "MIT", 423 | "dependencies": { 424 | "shebang-regex": "^3.0.0" 425 | }, 426 | "engines": { 427 | "node": ">=8" 428 | } 429 | }, 430 | "node_modules/shebang-regex": { 431 | "version": "3.0.0", 432 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 433 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 434 | "license": "MIT", 435 | "engines": { 436 | "node": ">=8" 437 | } 438 | }, 439 | "node_modules/signal-exit": { 440 | "version": "4.1.0", 441 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 442 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 443 | "license": "ISC", 444 | "engines": { 445 | "node": ">=14" 446 | }, 447 | "funding": { 448 | "url": "https://github.com/sponsors/isaacs" 449 | } 450 | }, 451 | "node_modules/source-map": { 452 | "version": "0.6.1", 453 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 454 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 455 | "license": "BSD-3-Clause", 456 | "engines": { 457 | "node": ">=0.10.0" 458 | } 459 | }, 460 | "node_modules/string-width": { 461 | "version": "5.1.2", 462 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", 463 | "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", 464 | "license": "MIT", 465 | "dependencies": { 466 | "eastasianwidth": "^0.2.0", 467 | "emoji-regex": "^9.2.2", 468 | "strip-ansi": "^7.0.1" 469 | }, 470 | "engines": { 471 | "node": ">=12" 472 | }, 473 | "funding": { 474 | "url": "https://github.com/sponsors/sindresorhus" 475 | } 476 | }, 477 | "node_modules/string-width-cjs": { 478 | "name": "string-width", 479 | "version": "4.2.3", 480 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 481 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 482 | "license": "MIT", 483 | "dependencies": { 484 | "emoji-regex": "^8.0.0", 485 | "is-fullwidth-code-point": "^3.0.0", 486 | "strip-ansi": "^6.0.1" 487 | }, 488 | "engines": { 489 | "node": ">=8" 490 | } 491 | }, 492 | "node_modules/string-width-cjs/node_modules/ansi-regex": { 493 | "version": "5.0.1", 494 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 495 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 496 | "license": "MIT", 497 | "engines": { 498 | "node": ">=8" 499 | } 500 | }, 501 | "node_modules/string-width-cjs/node_modules/emoji-regex": { 502 | "version": "8.0.0", 503 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 504 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 505 | "license": "MIT" 506 | }, 507 | "node_modules/string-width-cjs/node_modules/strip-ansi": { 508 | "version": "6.0.1", 509 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 510 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 511 | "license": "MIT", 512 | "dependencies": { 513 | "ansi-regex": "^5.0.1" 514 | }, 515 | "engines": { 516 | "node": ">=8" 517 | } 518 | }, 519 | "node_modules/strip-ansi": { 520 | "version": "7.1.0", 521 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 522 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 523 | "license": "MIT", 524 | "dependencies": { 525 | "ansi-regex": "^6.0.1" 526 | }, 527 | "engines": { 528 | "node": ">=12" 529 | }, 530 | "funding": { 531 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 532 | } 533 | }, 534 | "node_modules/strip-ansi-cjs": { 535 | "name": "strip-ansi", 536 | "version": "6.0.1", 537 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 538 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 539 | "license": "MIT", 540 | "dependencies": { 541 | "ansi-regex": "^5.0.1" 542 | }, 543 | "engines": { 544 | "node": ">=8" 545 | } 546 | }, 547 | "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { 548 | "version": "5.0.1", 549 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 550 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 551 | "license": "MIT", 552 | "engines": { 553 | "node": ">=8" 554 | } 555 | }, 556 | "node_modules/uglify-js": { 557 | "version": "3.19.3", 558 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", 559 | "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", 560 | "license": "BSD-2-Clause", 561 | "bin": { 562 | "uglifyjs": "bin/uglifyjs" 563 | }, 564 | "engines": { 565 | "node": ">=0.8.0" 566 | } 567 | }, 568 | "node_modules/upper-case": { 569 | "version": "1.1.3", 570 | "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", 571 | "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==", 572 | "license": "MIT" 573 | }, 574 | "node_modules/which": { 575 | "version": "2.0.2", 576 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 577 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 578 | "license": "ISC", 579 | "dependencies": { 580 | "isexe": "^2.0.0" 581 | }, 582 | "bin": { 583 | "node-which": "bin/node-which" 584 | }, 585 | "engines": { 586 | "node": ">= 8" 587 | } 588 | }, 589 | "node_modules/wrap-ansi": { 590 | "version": "8.1.0", 591 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", 592 | "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", 593 | "license": "MIT", 594 | "dependencies": { 595 | "ansi-styles": "^6.1.0", 596 | "string-width": "^5.0.1", 597 | "strip-ansi": "^7.0.1" 598 | }, 599 | "engines": { 600 | "node": ">=12" 601 | }, 602 | "funding": { 603 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 604 | } 605 | }, 606 | "node_modules/wrap-ansi-cjs": { 607 | "name": "wrap-ansi", 608 | "version": "7.0.0", 609 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 610 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 611 | "license": "MIT", 612 | "dependencies": { 613 | "ansi-styles": "^4.0.0", 614 | "string-width": "^4.1.0", 615 | "strip-ansi": "^6.0.0" 616 | }, 617 | "engines": { 618 | "node": ">=10" 619 | }, 620 | "funding": { 621 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 622 | } 623 | }, 624 | "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { 625 | "version": "5.0.1", 626 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 627 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 628 | "license": "MIT", 629 | "engines": { 630 | "node": ">=8" 631 | } 632 | }, 633 | "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { 634 | "version": "4.3.0", 635 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 636 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 637 | "license": "MIT", 638 | "dependencies": { 639 | "color-convert": "^2.0.1" 640 | }, 641 | "engines": { 642 | "node": ">=8" 643 | }, 644 | "funding": { 645 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 646 | } 647 | }, 648 | "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { 649 | "version": "8.0.0", 650 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 651 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 652 | "license": "MIT" 653 | }, 654 | "node_modules/wrap-ansi-cjs/node_modules/string-width": { 655 | "version": "4.2.3", 656 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 657 | "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 658 | "license": "MIT", 659 | "dependencies": { 660 | "emoji-regex": "^8.0.0", 661 | "is-fullwidth-code-point": "^3.0.0", 662 | "strip-ansi": "^6.0.1" 663 | }, 664 | "engines": { 665 | "node": ">=8" 666 | } 667 | }, 668 | "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { 669 | "version": "6.0.1", 670 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 671 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 672 | "license": "MIT", 673 | "dependencies": { 674 | "ansi-regex": "^5.0.1" 675 | }, 676 | "engines": { 677 | "node": ">=8" 678 | } 679 | } 680 | } 681 | } 682 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netlify-plugin-minify-html", 3 | "version": "0.3.1", 4 | "description": "A plugin to add HTML minification as a post-processing optimisation in Netlify", 5 | "main": "index.js", 6 | "keywords": [ 7 | "Netlify", 8 | "Plugin", 9 | "Optimisation", 10 | "Performance" 11 | ], 12 | "author": "Phil Hawksworth", 13 | "license": "ISC", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/philhawksworth/netlify-plugin-minify-html" 17 | }, 18 | "dependencies": { 19 | "@node-minify/core": "^9.0.2", 20 | "@node-minify/html-minifier": "^9.0.1" 21 | } 22 | } 23 | --------------------------------------------------------------------------------