Skip to content

Commit

Permalink
Update dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
shoonia committed Feb 27, 2024
1 parent fddbe0e commit 87b1e86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 52 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@typescript-eslint/parser": "^7.1.0",
"autoprefixer": "^10.4.17",
"babel-loader": "^9.1.3",
"babel-plugin-transform-remove-polyfill": "^0.8.0",
"babel-plugin-transform-remove-polyfill": "^0.9.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
Expand Down
47 changes: 0 additions & 47 deletions plugins/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ const components = new Set([
'ModalPortal',
]);

/**
* @type {import('@babel/types').LogicalExpression}
* @example
* ```
* this && this.__assign || functon() {}
* ```
*/
const objectAssignTs = {
operator: '||',
right: { type: 'FunctionExpression' },
left: {
operator: '&&',
type: 'LogicalExpression',
left: { type: 'ThisExpression' },
right: {
type: 'MemberExpression',
computed: false,
object: { type: 'ThisExpression' },
property: {
type: 'Identifier',
name: '__assign',
},
},
},
};

/**
* @type {import('@babel/types').AssignmentExpression}
* @example
Expand Down Expand Up @@ -127,27 +101,6 @@ const plugin = () => {
return {
name: 'minimizer',
visitor: {
// Remove `Object.assign` polyfill
LogicalExpression(path) {
const { node } = path;

if (isMatch(node, objectAssignTs)) {
path.replaceWith({
type: 'MemberExpression',
computed: false,
object: {
type: 'Identifier',
name: 'Object',
},
property: {
type: 'Identifier',
name: 'assign',
},
});
}
},

// Remove React PropTypes
AssignmentExpression(path) {
const { node } = path;

Expand Down

0 comments on commit 87b1e86

Please sign in to comment.