From 4d3d3e585fcf9bf01aa041a913852b476257c204 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Mon, 14 Sep 2026 20:33:29 +0000 Subject: [PATCH] build(deps-dev): bump babel from 7 to 8 Piecemeal Babel 8 bumps break mocha and the webpack docs build because modules:auto now assumes ESM. Replace babel-preset-react-app with preset-env/preset-react and compile tests to CommonJS. Closes #201 Closes #202 Closes #203 Co-authored-by: Cursor --- .babelrc | 15 --------------- babel.config.js | 11 +++++++++++ package.json | 12 +++++------- 3 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 .babelrc create mode 100644 babel.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 356c6ac..0000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": ["react-app"], - "plugins": [ - "@babel/plugin-syntax-class-properties", - "@babel/plugin-syntax-jsx", - "react-html-attrs" - ], - "env": { - "test": { - "plugins": [ - "istanbul" - ] - } - } -} \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..cfe82a4 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,11 @@ +module.exports = api => { + const isTest = api.env('test') + + return { + presets: [ + ['@babel/preset-env', { modules: isTest ? 'commonjs' : false }], + ['@babel/preset-react', { runtime: 'classic' }] + ], + plugins: ['react-html-attrs', isTest && 'istanbul'].filter(Boolean) + } +} diff --git a/package.json b/package.json index a179062..f70897c 100644 --- a/package.json +++ b/package.json @@ -285,18 +285,16 @@ "react-textarea-autosize": "~8.5.9" }, "devDependencies": { - "@babel/core": "^7.13.0", - "@babel/eslint-parser": "~7.29.7", - "@babel/plugin-proposal-private-property-in-object": "~7.21.11", - "@babel/plugin-syntax-class-properties": "~7.12.1", - "@babel/plugin-syntax-jsx": "~7.29.7", - "@babel/register": "7.29.7", + "@babel/core": "~8.0.5", + "@babel/eslint-parser": "~8.0.5", + "@babel/preset-env": "~8.0.5", + "@babel/preset-react": "~8.0.1", + "@babel/register": "~8.0.5", "@commitlint/cli": "latest", "@commitlint/config-conventional": "latest", "babel-loader": "10.1.1", "babel-plugin-istanbul": "8.0.0", "babel-plugin-react-html-attrs": "~3.0.5", - "babel-preset-react-app": "10.1.0", "browser-sync": "~3.0.3", "c8": "latest", "chai": "~6.2.2",