Skip to content

Commit 00b901e

Browse files
tniessenTrott
authored andcommitted
Revert "feat: minify HTML on build (#2537)"
This reverts commit 0cc3648. Refs: #2537
1 parent 85234cf commit 00b901e

File tree

3 files changed

+5
-134
lines changed

3 files changed

+5
-134
lines changed

build.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const markdown = require('metalsmith-markdown')
1616
const prism = require('metalsmith-prism')
1717
const permalinks = require('metalsmith-permalinks')
1818
const pagination = require('metalsmith-yearly-pagination')
19-
const htmlMinifier = require('metalsmith-html-minifier')
2019
const defaultsDeep = require('lodash.defaultsdeep')
2120
const autoprefixer = require('autoprefixer')
2221
const marked = require('marked')
@@ -47,33 +46,6 @@ const markedOptions = {
4746
renderer
4847
}
4948

50-
const htmlMinifierOpts = {
51-
collapseBooleanAttributes: true,
52-
collapseWhitespace: true,
53-
conservativeCollapse: true, // This is needed as things are now
54-
decodeEntities: true,
55-
minifyCSS: {
56-
level: {
57-
1: {
58-
specialComments: 0
59-
}
60-
}
61-
},
62-
minifyJS: false, // we don't have a lot inline JS and this slows down things
63-
minifyURLs: false,
64-
processConditionalComments: true,
65-
removeAttributeQuotes: true,
66-
removeComments: true,
67-
removeOptionalAttributes: true,
68-
removeOptionalTags: true,
69-
removeRedundantAttributes: true,
70-
removeScriptTypeAttributes: true,
71-
removeStyleLinkTypeAttributes: true,
72-
removeTagWhitespace: false,
73-
sortAttributes: true,
74-
sortClassName: true
75-
}
76-
7749
// This function imports a given language file and uses the default language set
7850
// in DEFAULT_LANG as a fallback to prevent any strings that aren't filled out
7951
// from appearing as blank.
@@ -207,8 +179,6 @@ function buildLocale (source, locale, opts) {
207179
pattern: /\.js$/
208180
}))
209181
.use(layouts())
210-
// Use the default options
211-
.use(process.env.NODE_ENV !== 'development' ? htmlMinifier({ minifierOptions: htmlMinifierOpts }) : '')
212182
// Pipes the generated files into their respective subdirectory in the build
213183
// directory.
214184
.destination(path.join(__dirname, 'build', locale))

package-lock.json

Lines changed: 5 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"metalsmith-discover-helpers": "^0.1.1",
5151
"metalsmith-discover-partials": "^0.1.2",
5252
"metalsmith-feed": "^1.0.0",
53-
"metalsmith-html-minifier": "^4.0.0",
5453
"metalsmith-layouts": "^2.3.1",
5554
"metalsmith-markdown": "^1.3.0",
5655
"metalsmith-metadata": "0.0.4",

0 commit comments

Comments
 (0)