var through = require('through-gulp');
var gutil = require('gulp-util');
var path = require('path');
var fs = require('fs');

var utils = require('./utils/utils.js');
var PLUGIN = 'gulp-release';

function publish(options) {
  return through(function(file, enc, callback) {
    if (file.isNull()) return callback(null, file);
    if (file.isStream()) return callback(new gutil.PluginError(PLUGIN, 'Streams are not supported!'));

    var blocks = utils.getSplitBlock(file.contents.toString());
    var result = utils.resolveSourceToDestiny(blocks);
    file.contents = new Buffer(result);
    if (options && options.enableResolve) {
      var fileSource = utils.getFileSource(blocks);
      utils.resolveFileSource(fileSource, options);
    }
    callback(null, file);
  }, function(callback) {
    callback();
  });
}

module.exports = publish;


@@ -214,15 +214,132 @@
 (opt
-ion
 s) %7B
+%0A  var defaults = %7B%0A    enableResolve: false,%0A    debug: false%0A  %7D;%0A%0A  var options = utils.shallowMerge(opts, defaults);
 %0A  r

add default options.