index.js
function mergeConfig(loaderConfig) {
  var defaultConfig = {
    // Web3
    provider: 'http://localhost:8545',

    // For deployment
    from: web3.eth.accounts[0],
    gasLimit: web3.eth.getBlock(web3.eth.defaultBlock).gasLimit,

    // Specify contract constructor parameters, if any.
    // constructorParams: {
    //   ContractOne: [ 'param1_value', 'param2_value' ]
    // }
    constructorParams: {},

    // To use deployed contracts instead of redeploying, include contract addresses in config
    // deployedContracts: {
    //   ContractOne: '0x...........',
    //   ContractTwo: '0x...........',
    // }
    deployedContracts: {}
  };

  var mergedConfig = loaderConfig;
  for (var key in defaultConfig) {
    if (!mergedConfig.hasOwnProperty(key)) {
      mergedConfig[key] = defaultConfig[key];
    }
  }
  return mergedConfig;
}
function mergeConfig(loaderConfig) {
  var defaultConfig = {
    // Web3
    provider: 'http://localhost:8545',

    // For deployment
    from: web3.eth.accounts[0],
    gasLimit: web3.eth.getBlock(web3.eth.defaultBlock).gasLimit,

    // Specify contract constructor parameters, if any.
    // constructorParams: {
    //   ContractOne: [ 'param1_value', 'param2_value' ]
    // }
    constructorParams: {},

    // To use deployed contracts instead of redeploying, include contract addresses in config
    // deployedContracts: {
    //   ContractOne: '0x...........',
    //   ContractTwo: '0x...........',
    // }
    deployedContracts: {}
  };

  var mergedConfig = loaderConfig;
  for (var key in defaultConfig) {
    if (!mergedConfig.hasOwnProperty(key)) {
      mergedConfig[key] = defaultConfig[key];
    }
  }
  return mergedConfig;
}
function mergeConfig ( loaderConfig ) { var defaultConfig = { // Web3 provider : 'http://localhost:8545' , // For deployment from : web3 . eth . accounts [ 0 ] , gasLimit : web3 . eth . getBlock ( web3 . eth . defaultBlock ) . gasLimit , // Specify contract constructor parameters, if any. // constructorParams: { //   ContractOne: [ 'param1_value', 'param2_value' ] // } constructorParams : { } , // To use deployed contracts instead of redeploying, include contract addresses in config // deployedContracts: { //   ContractOne: '0x...........', //   ContractTwo: '0x...........', // } deployedContracts : { } } ; var mergedConfig = loaderConfig ; for ( var key in defaultConfig ) { if ( ! mergedConfig . hasOwnProperty ( key ) ) { mergedConfig [ key ] = defaultConfig [ key ] ; } } return mergedConfig ; }
Merge loaderConfig and default configurations
Merge loaderConfig and default configurations