2017-08-03 17:46:49 +02:00
|
|
|
const { resolve } = require('path');
|
|
|
|
|
2017-08-24 19:27:52 +02:00
|
|
|
const env = process.env.NODE_ENV || 'development';
|
|
|
|
|
2017-05-03 02:04:16 +02:00
|
|
|
module.exports = {
|
2017-06-01 17:27:35 +02:00
|
|
|
test: /\.js$/,
|
2017-06-23 18:21:33 +02:00
|
|
|
// include react-intl because transform-react-remove-prop-types needs to apply to it
|
2017-06-25 12:49:53 +02:00
|
|
|
exclude: {
|
|
|
|
test: /node_modules/,
|
|
|
|
exclude: /react-intl[\/\\](?!locale-data)/,
|
|
|
|
},
|
2017-05-06 04:18:23 +02:00
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
2017-05-20 17:31:47 +02:00
|
|
|
forceEnv: process.env.NODE_ENV || 'development',
|
2017-07-18 05:06:31 +02:00
|
|
|
sourceRoot: 'app/javascript',
|
2017-08-24 19:27:52 +02:00
|
|
|
cacheDirectory: env === 'development' ? false : resolve(__dirname, '..', '..', '..', 'tmp', 'cache', 'babel-loader'),
|
2017-05-20 17:31:47 +02:00
|
|
|
},
|
|
|
|
};
|