How to use koa-html-minifier - 2 common examples

To help you get started, we’ve selected a few koa-html-minifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kiki-le-singe / react-redux-universal-boilerplate / src / server / View on Github external
import handleRender from 'server/utils/render'
import projectConfig, { paths } from '../../config'

const debug = _debug('app:server:prod')
const app = new Koa()
const { SERVER_HOST, SERVER_PORT } = projectConfig


  threshold: 2048,
  flush: require('zlib').Z_SYNC_FLUSH

  caseSensitive: true,
  // removeComments: true,
  removeCommentsFromCDATA: true,
  removeCDATASectionsFromCDATA: true,
  collapseWhitespace: true,
  collapseBooleanAttributes: true,
  collapseInlineTagWhitespace: true,
  removeAttributeQuotes: true,
  removeRedundantAttributes: true,
  removeScriptTypeAttributes: true,
  removeStyleLinkTypeAttributes: true,
  useShortDoctype: true,
  removeEmptyAttributes: true,
  removeOptionalTags: true,
  minifyJS: true,
  minifyCSS: true,
github UXtemple / panels / server / index.es6 View on Github external
export default function createServer({apps=[], heapId}) {
  const server = koa();

  apps.forEach(app => server.use(serve(`${app}/public`)));
  server.use(htmlMinifier({collapseWhitespace: true}));
  server.use(panels({heapId, prerender: !!process.env.PRERENDER}));

  return server;


minify HTML responses like some crazy guy

Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis

Popular koa-html-minifier functions