src/plugins/index.js
function IncludeContracts(
  contractsSelector,
  propertyFilter = ['interface', 'bytecode'],
  environmentName = 'contracts') {
  const self = this;
  self.process = ({ output, contracts }) => {
    // parse output
    const parsedOutput = JSON.parse(output);

    // add contracts environment
    parsedOutput[environmentName] = Object.assign({});

    // go through selected contracts
    contractsSelector.forEach((contractName) => {
      // if the contracts object has the selectedcontract
      // include it
      if ((contracts || {})[contractName]) {
        const contractObject = Object.assign({}, contracts[contractName]);

        // include contract data in environments output with property filter
        parsedOutput[environmentName][contractName] = propertyFilter ? keyFilter(contractObject, (key => propertyFilter.indexOf(key) !== -1)) : contractObject;
      }
    });

    return JSON.stringify(parsedOutput);
  };
}
function IncludeContracts(
  contractsSelector,
  propertyFilter = ['interface', 'bytecode'],
  environmentName = 'contracts') {
  const self = this;
  self.process = ({ output, contracts }) => {
    // parse output
    const parsedOutput = JSON.parse(output);

    // add contracts environment
    parsedOutput[environmentName] = Object.assign({});

    // go through selected contracts
    contractsSelector.forEach((contractName) => {
      // if the contracts object has the selectedcontract
      // include it
      if ((contracts || {})[contractName]) {
        const contractObject = Object.assign({}, contracts[contractName]);

        // include contract data in environments output with property filter
        parsedOutput[environmentName][contractName] = propertyFilter ? keyFilter(contractObject, (key => propertyFilter.indexOf(key) !== -1)) : contractObject;
      }
    });

    return JSON.stringify(parsedOutput);
  };
}
function IncludeContracts ( contractsSelector , propertyFilter = [ 'interface' , 'bytecode' ] , environmentName = 'contracts' ) { const self = this ; self . process = ( { output , contracts } ) => { // parse output const parsedOutput = JSON . parse ( output ) ; // add contracts environment parsedOutput [ environmentName ] = Object . assign ( { } ) ; // go through selected contracts contractsSelector . forEach ( ( contractName ) => { // if the contracts object has the selectedcontract // include it if ( ( contracts || { } ) [ contractName ] ) { const contractObject = Object . assign ( { } , contracts [ contractName ] ) ; // include contract data in environments output with property filter parsedOutput [ environmentName ] [ contractName ] = propertyFilter ? keyFilter ( contractObject , ( key => propertyFilter . indexOf ( key ) !== - 1 ) ) : contractObject ; } } ) ; return JSON . stringify ( parsedOutput ) ; } ; }
This wil include contracts data in the environments output

@method IncludeContracts
@param {Array} contractsSelector contracts to include in a contracts property
@param {Array} propertyFilter if fiter is not truthy, then ignore filtering
@param {String} environmentName environment name is usually contracts
@return {String} parsedOutput parsed output
This wil include contracts data in the environments output