💻
How are you using Babel?
babel-loader (webpack)
Input code
It is difficult to cite the code of the entire application and it is unclear at what point the failure occurs
Configuration file name
babel.config.js
Configuration
const coreJsVer = require('./coreJsVer');
const isTesting = process.env.NODE_ENV === 'test';
const isDev = process.env.NODE_ENV !== 'production';
module.exports = function (api) {
api.cache.using(() => process.env.NODE_ENV);
return {
comments: true,
presets: [
[
'@babel/preset-env',
{
loose: true,
debug: false,
modules: isTesting ? 'commonjs' : false,
corejs: {
version: coreJsVer,
proposals: true,
},
useBuiltIns: 'usage',
bugfixes: true,
},
],
[
'@babel/preset-react',
{
useBuiltIns: true,
runtime: 'automatic',
development: isDev,
},
],
'@babel/typescript',
],
plugins: ['./lazyComponentBabelPlugin.js', 'preval'],
env: {
production: {
plugins: [
'babel-plugin-transform-imports',
'babel-plugin-react-local',
// '@babel/plugin-transform-react-constant-elements',
],
ignore: ['**/*.test.tsx', '**/*.test.ts', '__snapshots__', '__tests__'],
},
development: {
plugins: [],
ignore: ['**/*.test.tsx', '**/*.test.ts', '__snapshots__', '__tests__'],
},
test: {
ignore: ['__snapshots__'],
},
},
};
};
Current and expected behavior
After updating the plugin, navigation in the application with react-router with code splitting stopped working
If you disable the plugin, everything works fine
Environment
- "@babel/core": "^7.17.7"
- Node v16.9.0
- Yarn 1.22.15
- OS: any
- Monorepo: no
Possible solution
No response
Additional context
No response
💻
How are you using Babel?
babel-loader (webpack)
Input code
Configuration file name
babel.config.js
Configuration
Current and expected behavior
After updating the plugin, navigation in the application with react-router with code splitting stopped working
If you disable the plugin, everything works fine
Environment
Possible solution
No response
Additional context
No response