Skip to content

Commit

Permalink
Fixes #37819 - Remove @theforeman/builder usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Sep 13, 2024
1 parent 1a5c1b9 commit da895e1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['@theforeman/builder/babel'],
presets: ['./webpack/babel'],
};
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"checkbox",
"clearbutton",
"clearfix",
"commonjs",
"comms",
"consts",
"cpu",
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const commonConfig = function() {
exclude: /node_modules(?!\/(@novnc|unidiff))/,
loader: 'babel-loader',
options: {
presets: [require.resolve('@theforeman/builder/babel')],
presets: [require.resolve('../webpack/babel')],
},
},
{
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@
"react-intl": "^2.8.0"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@theforeman/builder": "^13.1.0",
"@babel/core": "7.17.10",
"@babel/plugin-proposal-class-properties": "7.16.7",
"@babel/plugin-proposal-object-rest-spread": "7.16.7",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-modules-amd": "7.9.0",
"@babel/plugin-transform-modules-commonjs": "7.9.0",
"@babel/plugin-transform-modules-systemjs": "7.9.0",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/preset-env": "7.9.5",
"@babel/preset-react": "7.16.7",
"babel-plugin-dynamic-import-node": "2.3.0",
"@theforeman/eslint-plugin-foreman": "^13.1.0",
"@theforeman/eslint-plugin-rules": "^13.1.0",
"@theforeman/test": "^13.1.0",
Expand Down
4 changes: 4 additions & 0 deletions webpack/babel/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const presets = require('./presets');
const plugins = require('./plugins');

module.exports = () => ({ presets, plugins });
8 changes: 8 additions & 0 deletions webpack/babel/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = [
require.resolve('@babel/plugin-proposal-class-properties'),
require.resolve('@babel/plugin-proposal-object-rest-spread'),
require.resolve('@babel/plugin-proposal-optional-chaining'),
require.resolve('@babel/plugin-transform-object-assign'),
require.resolve('@babel/plugin-syntax-dynamic-import'),
require.resolve('@babel/plugin-syntax-optional-chaining'),
];
6 changes: 6 additions & 0 deletions webpack/babel/presets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const presets = [
[require.resolve('@babel/preset-env'), { modules: 'commonjs' }],
require.resolve('@babel/preset-react'),
];

module.exports = presets;

0 comments on commit da895e1

Please sign in to comment.