2019-03-16 01:05:31 +11:00
|
|
|
const { join } = require('path');
|
2023-05-24 01:15:17 +10:00
|
|
|
|
2019-03-16 01:05:31 +11:00
|
|
|
const { settings, env } = require('../configuration');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
test: /\.(js|mjs)$/,
|
|
|
|
include: /node_modules/,
|
2020-09-01 08:26:10 +10:00
|
|
|
exclude: [
|
|
|
|
/@babel(?:\/|\\{1,2})runtime/,
|
|
|
|
/tesseract.js/,
|
|
|
|
],
|
2019-03-16 01:05:31 +11:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
babelrc: false,
|
|
|
|
plugins: [
|
2019-03-30 11:41:35 +11:00
|
|
|
'transform-react-remove-prop-types',
|
2019-03-16 01:05:31 +11:00
|
|
|
],
|
|
|
|
cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
|
|
|
|
cacheCompression: env.NODE_ENV === 'production',
|
|
|
|
compact: false,
|
|
|
|
sourceMaps: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|