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

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

Use correct build stage name in jsLoader (#557)