Webpack dev server

To extend the dev server configuration, create a file ./tools/webpackConfig.js
Create the following content inside

module.exports = function(webpackConfig){
  return webpackConfig;
};

Example of extending the port used

Method one:
DEV_PORT=8003 npm start
Method two(Deprecated):

module.exports = function(webpackConfig){
  var newPort = 8003;
  webpackConfig.entry[0] = webpackConfig.entry[0].replace('8000',newPort);
  webpackConfig.devServer.port = newPort;
  return webpackConfig;
};

Jest configuration

To extend the Jest configuration, create a file ./tools/jestConfig.js
Create the following content inside

module.exports = function(jestConfig){

  return jestConfig;
};

Example of extending files we collect coverage from


module.exports = function(jestConfig){
  //collectCoverageFrom is already an array in the default configuration we use, but it's always safe to ensure it exists beforehand
  if(!jestConfig.collectCoverageFrom){
    jestConfig.collectCoverageFrom = [];
  }

  //let's prevent Jest from collecting code coverage from the examples directory - we don't plan on testing it anyway.
  jestConfig.collectCoverageFrom.push("!src/examples/**/*.*");
  return jestConfig;
};