about summary refs log tree commit diff
path: root/config/webpack/loaders/babel.js
blob: e17d2fa7013ba5fc6812379ff253245654804185 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
const { resolve } = require('path');

const env = process.env.NODE_ENV || 'development';

module.exports = {
  test: /\.js$/,
  exclude: /node_modules/,
  loader: 'babel-loader',
  options: {
    forceEnv: env,
    cacheDirectory: env === 'development' ? false : resolve(__dirname, '..', '..', '..', 'tmp', 'cache', 'babel-loader'),
  },
};