var _ = require('lodash');
var loaderUtils = require('loader-utils');
var minify = require('html-minifier').minify;

var defaults = require('./defaults');
var exportTemplate = require('./exportTemplate');

module.exports = function (source) {

  this.cacheable && this.cacheable();

  var queryOptions = loaderUtils.parseQuery(this.query);
  var config = _.object.merge({},
    defaults,
    this.options.underscoreTemplateLoader,
    queryOptions);
  var exportTemplateLocal = config.exportTemplate || exportTemplate;
  var template;
  var compiled;
  var exportedModule;

  template = config.minify ?
    minify(source, config.minifierOptions) : source;
  compiled = _.template(template, config.templateOptions);
  exportedModule = _.template(exportTemplateLocal, {
    engine: config.engine,
    template: template
  });

  return exportedModule;

};

@@ -151,58 +151,8 @@
 s');
-%0Avar exportTemplate = require('./exportTemplate');
 %0A%0Amo
@@ -397,77 +397,8 @@
 s);%0A
-  var exportTemplateLocal = config.exportTemplate %7C%7C exportTemplate;%0A
   va
@@ -619,16 +619,23 @@
 emplate(
+config.
 exportTe
@@ -644,13 +644,8 @@
 late
-Local
 , %7B%0A

Update index.js