Skip to content

Commit

Permalink
build: remove html-minifier because of security vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
engineervix committed Jul 20, 2024
1 parent 5408e02 commit b89bd99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 188 deletions.
19 changes: 0 additions & 19 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require("path");
const htmlmin = require("html-minifier");
const pluginRss = require("@11ty/eleventy-plugin-rss");

// const searchFilter = require("./app/utils/searchFilter.js");
Expand Down Expand Up @@ -37,24 +36,6 @@ module.exports = (eleventyConfig) => {
showVersion: true,
});

if (process.env.ELEVENTY_ENV === "production") {
eleventyConfig.addTransform("htmlmin", (content, outputPath) => {
if (outputPath.endsWith(".html")) {
const minified = htmlmin.minify(content, {
collapseInlineTagWhitespace: false,
collapseWhitespace: true,
removeComments: true,
sortClassName: true,
useShortDoctype: true,
});

return minified;
}

return content;
});
}

// You can return your Config object (optional).
return {
dir: {
Expand Down
171 changes: 3 additions & 168 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"eslint-webpack-plugin": "^4.0.1",
"file-loader": "^6.2.0",
"he": "^1.2.0",
"html-minifier": "^4.0.0",
"mini-css-extract-plugin": "^2.7.6",
"mustache": "^4.2.0",
"node-sass": "^9.0.0",
Expand Down

0 comments on commit b89bd99

Please sign in to comment.