Optimize cssnano plugin

@param {Object} options
6034
function OptimizeCssnanoPlugin(options) {
  this.options = Object.assign({
    sourceMap: false,
    cssnanoOptions: {
      preset: 'default',
    },
  }, options);

  if (this.options.sourceMap) {
    this.options.sourceMap = Object.assign(
      {inline: false},
      this.options.sourceMap || {});
  }
}
1184278
function FilterCSS (options) {
  options = shallowCopyObject(options || {});
  options.whiteList = options.whiteList || DEFAULT.whiteList;
  options.onAttr = options.onAttr || DEFAULT.onAttr;
  options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT.onIgnoreAttr;
  options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
  this.options = options;
}
794206
function setupStyleguide(options) {
  let cwd = !!options && !!options.cwd ? options.cwd : process.cwd()
  success('Styleguide.new:', 'initialize styleguide ...')
  return new Styleguide()
    .initialize(cwd)
    .then(function (styleguide) {
      success('Styleguide.new:', 'initialize finished')
      if (!options || !options.prepare) {
        success('Styleguide.prepare:', 'preparing the styleguide target ...')
        return styleguide.prepare()
      } else {
        return Promise.resolve(styleguide)
      }
    })
}
604989
function(options) {
        this.originHTML = this.$main.html();

        this.$main.addClass([defaultClass, options.customClass, prefix + options.theme].join(' '));

        if (options.size === 'large') {
            this.$main.addClass(largeClass);
        }

        if (options.text) {
            this.$main.html(options.text);
        }

        if (options.icon) {
            var iconName = !document.documentMode ? options.icon : window.bizui.codepoints[options.icon];
            this.$main.prepend('<i class="biz-icon">' + iconName + '</i> ');
        }

        if (options.disabled) {
            this.disable();
        }
    }
91709
function (options) {
      //console.log(util.inspect(options.project, false, null));
      var entity = options.entity;

      addScssToImportFile(entity.name, {
          name: entity.name,
          root: options.project.root,
          podsDir: this.podsDir
      });
  }
1191671
function(n, fast, css_animation) {
		var self = 	this,
			_ease = this.options.ease,
			_duration = this.options.duration,
			_n = (n < 0) ? 0 : n;

		// Set Marker active state
		this._resetMarkersActive();
		if(n >= 0 && n < this._markers.length) {
		    this._markers[n].setActive(true);
		}
		// Stop animation
		if (this.animator) {
			this.animator.stop();
		}

		if (fast) {
			this._el.slider.className = "tl-timenav-slider";
			this._el.slider.style.left = -this._markers[_n].getLeft() + (this.options.width/2) + "px";
		} else {
			if (css_animation) {
				this._el.slider.className = "tl-timenav-slider tl-timenav-slider-animate";
				this.animate_css = true;
				this._el.slider.style.left = -this._markers[_n].getLeft() + (this.options.width/2) + "px";
			} else {
				this._el.slider.className = "tl-timenav-slider";
				this.animator = TL.Animate(this._el.slider, {
					left: 		-this._markers[_n].getLeft() + (this.options.width/2) + "px",
					duration: 	_duration,
					easing: 	_ease
				});
			}
		}

		if(n >= 0 && n < this._markers.length) {
		    this.current_id = this._markers[n].data.unique_id;
		} else {
		    this.current_id = '';
		}
	}
891999
protected function _initialize($options = array()) {
		if ($this->_initialized) {
			return;
		}

		$this->_initialized = true;
		if (!empty($options['_css'])) {
			foreach ((array)$options['_css'] as $css) {
				$this->Html->css($css, null, array('inline' => false));
			}
		}

		if (!empty($options['_cssText'])) {
			$out = $this->Html->tag('style', $options['_cssText']);
			$this->_View->append('css', $out);
		}

		if (!empty($options['_scriptBlock'])) {
			$scriptOpts = array('block' => $options['_scriptBlock']);
		} else {
			$scriptOpts = false;
		}

		if (!empty($options['_scripts'])) {
			foreach ((array)$options['_scripts'] as $script) {
				$this->Html->script($script, $scriptOpts);
			}
		}
	}
1304707
function(options) {
    options = options || {};
    var self = this;

    if (options.transition && !options.duration) {
      throw new Error('"options.duration" is required when "options.transition" is enabled.');
    }

    var transitionName = util.transitionPropertyName;

    if (options.transition || (options.duration && options.duration > 0)) {
      var transitionValue = options.transition || ('all ' + options.duration + 's ' + (options.timing || 'linear'));

      this.transitionQueue.push(function(done) {
        var elements = this.elements;
        var timeoutId;

        var clearTransition = function() {
          elements.forEach(function(element) {
            element.style[transitionName] = '';
          });
        };

        // add "transitionend" event handler
        var removeListeners = util.onceOnTransitionEnd(elements[0], function() {
          clearTimeout(timeoutId);
          clearTransition();
          done();
        });

        // for fail safe.
        timeoutId = setTimeout(function() {
          removeListeners();
          clearTransition();
          done();
        }, options.duration * 1000 * TIMEOUT_RATIO);

        // transition and style settings
        elements.forEach(function(element, index) {

          var css = self.lastStyleAttributeDict[index];

          if (!css) {
            throw new Error('restoreStyle(): The style is not saved. Invoke saveStyle() before.');
          }

          self.lastStyleAttributeDict[index] = undefined;

          var name;
          for (var i = 0, len = element.style.length; i < len; i++) {
            name = element.style[i];
            if (css[name] === undefined) {
              css[name] = '';
            }
          }

          element.style[transitionName] = transitionValue;

          Object.keys(css).forEach(function(key) {
            if (key !== transitionName) {
              element.style[key] = css[key];
            }
          });

          element.style[transitionName] = transitionValue;
        });
      });
    } else {
      this.transitionQueue.push(function(done) {
        reset();
        done();
      });
    }

    return this;

    function reset() {
      // Clear transition animation settings.
      self.elements.forEach(function(element, index) {
        element.style[transitionName] = 'none';

        var css = self.lastStyleAttributeDict[index];

        if (!css) {
          throw new Error('restoreStyle(): The style is not saved. Invoke saveStyle() before.');
        }

        self.lastStyleAttributeDict[index] = undefined;

        for (var i = 0, name = ''; i < element.style.length; i++) {
          name = element.style[i];
          if (typeof css[element.style[i]] === 'undefined') {
            css[element.style[i]] = '';
          }
        }

        Object.keys(css).forEach(function(key) {
          element.style[key] = css[key];
        });

      });
    }
  }
1266519
function suit(options) {
  options = options || {};
  // for backwards compatibility with rework-npm < 1.0.0
  options.root = options.root || options.dir;

  return function (ast, reworkObj) {
    reworkObj
      // inline imports
      .use(inliner({
        alias: options.alias,
        prefilter: function (css) {
          // per-file conformance checks
          return rework(css).use(conformance).toString();
        },
        root: options.root,
        shim: options.shim,
      }))
      // check if the number of selectors exceeds the IE limit
      .use(limits)
      // custom media queries
      .use(customMedia)
      // variables
      .use(vars())
      // calc
      .use(calc);
  };
}
322256
function (cssText, options) {
    var container = document.head || document.getElementsByTagName('head')[0]
    var style = document.createElement('style')
    options = options || {}
    style.type = 'text/css'
    if (options.href) {
      style.setAttribute('data-href', options.href)
    }
    if (style.sheet) { // for jsdom and IE9+
      style.innerHTML = cssText
      style.sheet.cssText = cssText
    }
    else if (style.styleSheet) { // for IE8 and below
      style.styleSheet.cssText = cssText
    }
    else { // for Chrome, Firefox, and Safari
      style.appendChild(document.createTextNode(cssText))
    }
    if (options.prepend) {
      container.insertBefore(style, container.childNodes[0]);
    } else {
      container.appendChild(style);
    }
    return style
  }
429779
function resolveConfig(css, result, options) {
  if (options.preset) {
    return resolvePreset(options.preset);
  }

  const inputFile = css.source && css.source.input && css.source.input.file;
  let searchPath = inputFile ? path.dirname(inputFile) : process.cwd();
  let configPath = null;

  if (options.configFile) {
    searchPath = null;
    configPath = path.resolve(process.cwd(), options.configFile);
  }

  const configExplorer = cosmiconfig(cssnano);
  const searchForConfig = configPath
    ? configExplorer.load(configPath)
    : configExplorer.search(searchPath);

  return searchForConfig.then((config) => {
    if (config === null) {
      return resolvePreset('default');
    }

    return resolvePreset(config.config.preset || config.config);
  });
}
23975
function (startDir, config) {
            if (config.optimizeCss.indexOf("standard") !== -1) {
                var i, fileName,
                    fileList = file.getFilteredFileList(startDir, /\.css$/, true);
                if (fileList) {
                    for (i = 0; i < fileList.length; i++) {
                        fileName = fileList[i];
                        logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName);
                        optimize.cssFile(fileName, fileName, config);
                    }
                }
            }
        }
444892
function htmlLoaderOptions(options) {
  return {
    loader: 'html-loader',
    options: Object.assign({}, options, {
      minimize: options.env === 'development' ? false : true
    })
  }
}
1103837
function mincss(config, tools) {
  return tools.simpleStream(config, [
    config.autoprefixer && autoprefixer(config.autoprefixer),
    config.concat && concat(config.concat),
    config.minify && csso(config.csso)
  ])
}
1010510
function(opts, done) {
    if (typeof opts !== 'object') {
      done = opts;
      opts = null;
    }
    validateCallback(done);
    this.parse(opts);
    this.renderCSS(done);
    return this;
  }
145843
function minify(options){
	var UglifyJS = require("uglify-js");

	//var result = UglifyJS.minify(code, opts)

	return through.obj(function(data, enc, next){
		var bundle = data.bundles[0];
		var source = bundle.source;

		var opts = { fromString: true };
		if(source.map) {
			var inMap = source.map.toJSON();
			var file = inMap.sources && inMap.sources[0];
			opts.inSourceMap = inMap;
			opts.outSourceMap = file;

			if(options.sourceMapsContent) {
				opts.sourceMapIncludeSources = true;
			}
		}

		try {
			var result = UglifyJS.minify(source.code, opts);
			result.code = removeSourceMapUrl(result.code);

			bundle.source = result;
			next(null, data);
		} catch(err) {
			next(err);
		}

	});
}
1384
function optimize(data) {
		if (typeof data == 'string') {
			data = JSON.parse(data);
		}

		return {
			vendors: parseVendors(data),
			css: parseCSS(data),
			era: parseEra(data)
		};
	}