From 3701621f6dc4d88c2c4422dfd799fff383913149 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Mon, 9 Sep 2024 16:40:02 +0630 Subject: [PATCH] Cleanup babel config (#5414) --- .babelrc | 19 ----- babel.config.json | 10 +++ package-lock.json | 150 +---------------------------------- package.json | 6 -- webpack.config.js | 2 +- webpack.l10n.config.babel.js | 2 +- 6 files changed, 13 insertions(+), 176 deletions(-) delete mode 100644 .babelrc create mode 100644 babel.config.json diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 7c2017a3..00000000 --- a/.babelrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "presets": [ - "@babel/preset-env" - ], - "plugins": [ - "@babel/plugin-transform-modules-commonjs", - [ - "@babel/plugin-proposal-decorators", - { - "legacy": true - } - ], - "@babel/plugin-proposal-function-sent", - "@babel/plugin-proposal-export-namespace-from", - "@babel/plugin-proposal-numeric-separator", - "@babel/plugin-proposal-throw-expressions", - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 00000000..13280383 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,10 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "modules": "commonjs" + } + ] + ] +} diff --git a/package-lock.json b/package-lock.json index 29665d81..8a04f9a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,12 +44,6 @@ "@babel/cli": "7.25.6", "@babel/core": "7.25.2", "@babel/eslint-parser": "7.25.1", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/plugin-proposal-decorators": "7.24.7", - "@babel/plugin-proposal-export-namespace-from": "7.18.9", - "@babel/plugin-proposal-function-sent": "7.24.7", - "@babel/plugin-proposal-numeric-separator": "7.18.6", - "@babel/plugin-proposal-throw-expressions": "7.24.7", "@babel/preset-env": "7.25.4", "@babel/register": "7.24.6", "async": "3.2.6", @@ -780,88 +774,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.7.tgz", - "integrity": "sha512-RL9GR0pUG5Kc8BUWLNDm2T5OpYwSX15r98I0IkgmRQTXuELq/OynH8xtMTMvTJFjXbMWFVTKtYkTaYQsuAwQlQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-decorators": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-function-sent": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.24.7.tgz", - "integrity": "sha512-42Pq9d8fV5CrjygcVAA7aAEFpkAJluWWvlO7bvOMDEutxIS44COcFU61V92VBzUZvOkjIoQrPJNUtmY/d9XMgA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-wrap-function": "^7.24.7", - "@babel/plugin-syntax-function-sent": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", - "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-private-property-in-object": { "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", @@ -874,22 +786,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-throw-expressions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.24.7.tgz", - "integrity": "sha512-Rh4WoHyWKgsxvdkEMqDEZtKuGnZw+JwicMCvcZaIjYaQ3fK+a8JZYLhgcac9dKcL47Xqf+SG3MopTx+8BACdrQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-throw-expressions": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -941,21 +837,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-decorators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.24.7.tgz", - "integrity": "sha512-Ui4uLJJrRV1lb38zg1yYTmRKmiZLiftDEvZN2iq3kd9kUFU+PttmzTbAFC2ucRk/XJmtek6G23gPsuZbhrT8fQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -980,21 +861,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-function-sent": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.24.7.tgz", - "integrity": "sha512-me5EHEx4GXxAE8mnlZaWA+ARIyMSPOXcw6WlqWGIfTg36oeWm4FxR/Djs1DGPbmSIwJqMboiN7gK8eCyzyNK2A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-import-assertions": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", @@ -1151,21 +1017,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-throw-expressions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.24.7.tgz", - "integrity": "sha512-b1bdlAmUTy9VQ/g2cnBuJFwd7jeARNW2F65c9Gcn8qyNYGuVy/cYyqpiSL6SVmUAJTDbIYL2FzlZ8nH1qUCBXA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-top-level-await": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", @@ -1587,6 +1438,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-transforms": "^7.24.8", "@babel/helper-plugin-utils": "^7.24.8", diff --git a/package.json b/package.json index fbe19e20..122e48d3 100644 --- a/package.json +++ b/package.json @@ -76,12 +76,6 @@ "@babel/cli": "7.25.6", "@babel/core": "7.25.2", "@babel/eslint-parser": "7.25.1", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/plugin-proposal-decorators": "7.24.7", - "@babel/plugin-proposal-export-namespace-from": "7.18.9", - "@babel/plugin-proposal-function-sent": "7.24.7", - "@babel/plugin-proposal-numeric-separator": "7.18.6", - "@babel/plugin-proposal-throw-expressions": "7.24.7", "@babel/preset-env": "7.25.4", "@babel/register": "7.24.6", "async": "3.2.6", diff --git a/webpack.config.js b/webpack.config.js index 4172b8da..d406d9f5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,7 +24,7 @@ module.exports = { rules: [ { use: 'babel-loader', - // babel options are in .babelrc + // babel options are in babel.config.json exclude: /(node_modules|bower_components)/, test: /\.js$/, }, diff --git a/webpack.l10n.config.babel.js b/webpack.l10n.config.babel.js index b6156630..4da386bd 100644 --- a/webpack.l10n.config.babel.js +++ b/webpack.l10n.config.babel.js @@ -5,7 +5,7 @@ const webpack = require('webpack'); const webpackConfig = require('./webpack.config'); -const babelrc = fs.readFileSync('./.babelrc'); +const babelrc = fs.readFileSync('./babel.config.json'); const babelrcObject = JSON.parse(babelrc); const babelPlugins = babelrcObject.plugins || [];