Comparing version 0.6.0 to 0.7.0
@@ -12,3 +12,3 @@ "use strict"; | ||
const path = __importStar(require("path")); | ||
const pretty = require("pretty"); | ||
const html_minifier_1 = require("html-minifier"); | ||
const handlebars = __importStar(require("handlebars")); | ||
@@ -33,3 +33,8 @@ const ampify = require("@bradymholt/ampify"); | ||
if (this.prettyHtml) { | ||
ampOutput = pretty(ampOutput, { ocd: true }); | ||
// TODO: DRY up minify options | ||
ampOutput = html_minifier_1.minify(ampOutput, { | ||
minifyJS: false, | ||
collapseWhitespace: false, | ||
processConditionalComments: false | ||
}); | ||
} | ||
@@ -36,0 +41,0 @@ fs.writeFileSync(path.join(this.baseDestDirectory, page.path, this.ampPageName), ampOutput); |
@@ -14,3 +14,3 @@ "use strict"; | ||
const marked = require("marked"); | ||
const pretty = require("pretty"); | ||
const html_minifier_1 = require("html-minifier"); | ||
const matter = require("gray-matter"); | ||
@@ -28,3 +28,3 @@ const prismjs = require("prismjs"); | ||
this.renderAmpPages = true; | ||
this.prettyHtml = true; | ||
this.minifyHtml = true; | ||
this.codeHighlight = true; | ||
@@ -135,4 +135,8 @@ this.initialized = false; | ||
let templatedOutput = applyTemplate(templateData); | ||
if (this.prettyHtml) { | ||
templatedOutput = pretty(templatedOutput, { ocd: true }); | ||
if (this.minifyHtml) { | ||
templatedOutput = html_minifier_1.minify(templatedOutput, { | ||
minifyJS: false, | ||
collapseWhitespace: false, | ||
processConditionalComments: false | ||
}); | ||
} | ||
@@ -139,0 +143,0 @@ // Write file |
@@ -12,3 +12,3 @@ "use strict"; | ||
const path = __importStar(require("path")); | ||
const pretty = require("pretty"); | ||
const html_minifier_1 = require("html-minifier"); | ||
const matter = require("gray-matter"); | ||
@@ -19,3 +19,3 @@ class TemplateGenerator { | ||
// Options | ||
this.prettyHtml = true; | ||
this.minifyHtml = true; | ||
this.baseTemplateData = baseTemplateData; | ||
@@ -68,3 +68,7 @@ this.templateManager = templateManager; | ||
} | ||
templateLayoutOutput = pretty(templateLayoutOutput, { ocd: true }); | ||
templateLayoutOutput = html_minifier_1.minify(templateLayoutOutput, { | ||
minifyJS: false, | ||
collapseWhitespace: false, | ||
processConditionalComments: false | ||
}); | ||
// Write file | ||
@@ -71,0 +75,0 @@ // TODO: config base_path is ignored for template files...I think this is ok but need to make obvious. |
{ | ||
"name": "xertz", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "xertz", | ||
@@ -23,2 +23,3 @@ "author": "Brady Holt", | ||
"@bradymholt/ampify": "^1.1.0", | ||
"@types/html-minifier": "^3.5.3", | ||
"dateformat": "^3.0.3", | ||
@@ -29,13 +30,13 @@ "express": "^4.16.4", | ||
"handlebars": "^4.1.2", | ||
"html-minifier": "^4.0.0", | ||
"js-yaml": "^3.13.1", | ||
"marked": "^0.6.2", | ||
"node-sass": "^4.11.0", | ||
"pretty": "^2.0.0", | ||
"prismjs": "^1.16.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.11", | ||
"@types/dateformat": "^3.0.0", | ||
"@types/express": "^4.16.1", | ||
"@types/fs-extra": "^5.0.5", | ||
"@types/jest": "^24.0.11", | ||
"@types/js-yaml": "^3.12.1", | ||
@@ -45,9 +46,8 @@ "@types/marked": "^0.6.5", | ||
"@types/node-sass": "^4.11.0", | ||
"@types/pretty": "^2.0.0", | ||
"@types/prismjs": "^1.16.0", | ||
"jest": "^24.7.1", | ||
"ts-jest": "^24.0.2", | ||
"ts-node": "^8.1.0", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "^3.4.4" | ||
} | ||
} |
34156
13
791
12
+ Added@types/html-minifier@^3.5.3
+ Addedhtml-minifier@^4.0.0
+ Added@types/clean-css@4.2.11(transitive)
+ Added@types/html-minifier@3.5.3(transitive)
+ Added@types/node@22.13.1(transitive)
+ Added@types/relateurl@0.2.33(transitive)
+ Added@types/uglify-js@3.17.5(transitive)
+ Addedcamel-case@3.0.0(transitive)
+ Addedclean-css@4.2.4(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedhtml-minifier@4.0.0(transitive)
+ Addedlower-case@1.1.4(transitive)
+ Addedno-case@2.3.2(transitive)
+ Addedobject-inspect@1.13.4(transitive)
+ Addedparam-case@2.1.1(transitive)
+ Addedrelateurl@0.2.7(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedupper-case@1.1.3(transitive)
- Removedpretty@^2.0.0
- Removed@isaacs/cliui@8.0.2(transitive)
- Removed@one-ini/wasm@0.1.1(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removedabbrev@2.0.0(transitive)
- Removedansi-regex@5.0.16.1.0(transitive)
- Removedansi-styles@4.3.06.2.1(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcommander@10.0.1(transitive)
- Removedcondense-newlines@0.2.1(transitive)
- Removedconfig-chain@1.1.13(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedeastasianwidth@0.2.0(transitive)
- Removededitorconfig@1.0.4(transitive)
- Removedemoji-regex@8.0.09.2.2(transitive)
- Removedforeground-child@3.3.0(transitive)
- Removedglob@10.4.5(transitive)
- Removedini@1.3.8(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedis-whitespace@0.3.0(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedjs-beautify@1.15.1(transitive)
- Removedjs-cookie@3.0.5(transitive)
- Removedkind-of@3.2.2(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedminimatch@9.0.19.0.5(transitive)
- Removedminipass@7.1.2(transitive)
- Removednopt@7.2.1(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedpackage-json-from-dist@1.0.1(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
- Removedpretty@2.0.0(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedsemver@7.7.0(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@4.1.0(transitive)
- Removedstring-width@4.2.35.1.2(transitive)
- Removedstrip-ansi@6.0.17.1.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@7.0.08.1.0(transitive)