Improve Babel configuration and automatically load polyfills (#27333)
This commit is contained in:
parent
9c8891b39a
commit
0e3401bc1c
10 changed files with 30 additions and 126 deletions
|
@ -1,27 +0,0 @@
|
|||
const { join } = require('path');
|
||||
|
||||
const { settings, env } = require('../configuration');
|
||||
|
||||
module.exports = {
|
||||
test: /\.(js|mjs)$/,
|
||||
include: /node_modules/,
|
||||
exclude: [
|
||||
/@babel(?:\/|\\{1,2})runtime/,
|
||||
/tesseract.js/,
|
||||
],
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
babelrc: false,
|
||||
plugins: [
|
||||
'transform-react-remove-prop-types',
|
||||
],
|
||||
cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
|
||||
cacheCompression: env.NODE_ENV === 'production',
|
||||
compact: false,
|
||||
sourceMaps: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue