docs: function reduced(err, result) {
      if (err) return done(err);
  
      var collections = []
        , distributions = self.distributions
        , stack = {
              'plugin::once': []
            , 'plugin::modifier': []
            , 'plugin::after': []
          };
  
      _.forEach(result, function each(content, extension) {
        // Again, add a semicolon because minifiers could strip the last
        // semi-colon as it would reduce the portability of the generated code
        if (extension === 'js') content = self.semicolon(content);
  
        // Generate a collection object that is passed in to each middleware
        // layer. These objects should always have a content and extension key.
        distributions.forEach(function distribution(dist) {
          collections.push({
              extension: extension
            , content: content
            , platform: platform
            , distribution: dist
          });
        });
      });
  
      // Sort middleware layers as plugins are separated by plugin
      // types (if you use the plugin interface correctly).
      self.middleware.forEach(function groupPlugins(plugin) {
        var layertype = plugin.interface.prototype.type;
  
        // Default to modified if no type is set.
        if (!layertype || typeof layertype !== 'string') layertype = 'plugin::modifier';
  
        stack[layertype].push(plugin);
      });
  
      // Overload type:once plugins, then all type:modifier finally type:after
      // with functions for proper calling in async.series.
      _.each(stack, function createCallStack(plugins, key) {
        if (!plugins.length) return delete stack[key];
  
        // Type:once plugins only need to call forEach once.
        stack[key] = key === 'plugin::once'
          ? function (cb) { self.forEach.call(self, plugins, [], cb); }
          : function (cb) { async.map(collections, self.forEach.bind(self, plugins), cb); };
      });
  
      // Drop incomplete results, for instance from type:once plugins.
      self.logger.debug('Iterating over the plugin middleware');
      async.series(stack, function (err, pack) {
        var final = [];
  
        if ('plugin::modifier' in pack) final = final.concat(pack['plugin::modifier']);
        if ('plugin::after' in pack) final = final.concat(pack['plugin::after']);
  
        // If we got no collections from plugins, default to development.
        if (!final.length) final = collections;
        writer(err, final);
      });
    }