From 385a0c53276d4f2f73f8ecbb466045c7a22ed603 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 27 May 2016 06:25:28 +0100 Subject: [PATCH] Added imagemin --- app.js | 7 +++++++ package.json | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app.js b/app.js index cefa4d6..4515f6f 100644 --- a/app.js +++ b/app.js @@ -14,9 +14,11 @@ const pagination = require('metalsmith-pagination'); const define = require('metalsmith-define'); const feed = require('metalsmith-feed'); const sass = require('metalsmith-sass'); +const imagemin = require('metalsmith-imagemin'); const Handlebars = require('handlebars'); const emoji = require('markdown-it-emoji'); const moment = require('moment'); +const imageminMozjpeg = require('imagemin-mozjpeg'); const port = process.env.PORT || 8000; const oneDay = 86400000; @@ -99,6 +101,11 @@ Metalsmith(__dirname) partials: 'templates/partials' })) .use(sass()) + .use(imagemin({ + plugins: [ + imageminMozjpeg({progressive: true}) + ] + })) .build(function(err) { if (err) throw err; diff --git a/package.json b/package.json index a661be2..c9434e6 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,13 @@ "compression": "^1.6.2", "express": "^4.13.4", "handlebars": "^4.0.5", + "imagemin-mozjpeg": "^6.0.0", "markdown-it-emoji": "^1.1.1", "metalsmith": "^2.1.0", "metalsmith-collections": "^0.7.0", "metalsmith-define": "^2.0.1", "metalsmith-feed": "^0.2.0", + "metalsmith-imagemin": "^1.2.0", "metalsmith-in-place": "^1.4.4", "metalsmith-layouts": "^1.6.5", "metalsmith-markdownit": "^0.3.0",