export default function ({ config, stage }) {
  return {
    test: /\.(js|jsx)$/,
    exclude: /node_modules.*/,
    use: [
      {
        loader: 'babel-loader',
        options: {
          cacheDirectory: stage !== 'prod',
        },
      },
      {
        loader: 'react-hot-loader-loader',
      },
    ],
  }
}
