 gutil   = require 'gulp-util'
 extend  = require 'extend'
 log     = require 'ewg-logging'
-htmlmin = require 'htmlmin'
+minify = require('html-minifier').minify
 
 PluginError    = gutil.PluginError
 EWGHamlContext = require './context'


class EWGHamlRenderer
  constructor: (@config) ->
    extend(true, defaultCompilerConfig,
                 @config.compiler)

    @layout  = new EWGHamlLayout(@config)

    @layout.fromContent content, (layout) =>
      output = @renderFileSync layout, context
      output = @resolveContentFor(output, context)
      output = minify(output, @config.minimize) if @config.minimize.enabled

      file.path     = @replaceExtension file.path
      file.contents = new Buffer(output)
