I have already updated babel-loader and babel/core to newest.
"babel-loader": "8.2.2",
"@babel/core": "7.14.3",
It says that this is related to .babelrc, should use babel.config.js, not .babelrc, according to this question.
I have also updated the config, but still no luck.
react-spring,@react-spring,rafz should be transpired, but they don't.
exports.loadJavaScript = () => {
return {
module: {
rules: [
{
test: [/\.jsx?$/, /\.js$/],
include: [resolve('../src')],
exclude: /node_modules(?!\/(react-spring|@react-spring|rafz))/,
use: [
{
loader: 'thread-loader',
options: jsWorkerPool,
},
{
loader: 'babel-loader',
options: {
babelrc: false,
cacheDirectory: true,
configFile: path.resolve(
__dirname,
'../babel.config.js',
),
}
},
],
},
],
},
}};
module.exports = api => {
const isDevelopment = process.env.NODE_ENV !== 'production';
const enableRefresh = process.env.NOREFRESH !== 'true';
api.cache.using(() => process.env.NODE_ENV);
return {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: { version: 3, proposals: true },
targets: {
browsers: ['last 2 versions', 'safari >= 7', 'ie >= 11'],
},
},
],
'@babel/preset-react',
],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import',
isDevelopment && enableRefresh && require.resolve('react-refresh/babel'),
].filter(Boolean),
};
};
anyone can help?