From 30f1c68e9ee3e38ee30c21fdbeaca100121339ea Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 2 Dec 2023 16:49:00 +0800 Subject: [PATCH] fix(plugin-babel): lodash breaks the mjs artifact --- .changeset/young-guests-shop.md | 5 +++++ packages/plugin-babel/package.json | 2 -- packages/plugin-babel/src/plugin.ts | 3 +-- pnpm-lock.yaml | 6 ------ 4 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 .changeset/young-guests-shop.md diff --git a/.changeset/young-guests-shop.md b/.changeset/young-guests-shop.md new file mode 100644 index 0000000000..be63c3a466 --- /dev/null +++ b/.changeset/young-guests-shop.md @@ -0,0 +1,5 @@ +--- +'@rsbuild/plugin-babel': patch +--- + +fix(plugin-babel): lodash breaks the mjs artifact diff --git a/packages/plugin-babel/package.json b/packages/plugin-babel/package.json index 9e4a4b0726..6ab6d43786 100644 --- a/packages/plugin-babel/package.json +++ b/packages/plugin-babel/package.json @@ -30,13 +30,11 @@ "@rsbuild/shared": "workspace:*", "@types/babel__core": "^7.20.3", "babel-loader": "9.1.3", - "lodash": "^4.17.21", "upath": "2.0.1" }, "devDependencies": { "@rsbuild/core": "workspace:*", "@rsbuild/test-helper": "workspace:*", - "@types/lodash": "^4.14.200", "@types/node": "^16", "typescript": "^5.3.0" }, diff --git a/packages/plugin-babel/src/plugin.ts b/packages/plugin-babel/src/plugin.ts index b7ff5fbdf1..c898f8f6e0 100644 --- a/packages/plugin-babel/src/plugin.ts +++ b/packages/plugin-babel/src/plugin.ts @@ -1,6 +1,5 @@ import type { RsbuildPlugin } from '@rsbuild/core'; -import { SCRIPT_REGEX } from '@rsbuild/shared'; -import { cloneDeep } from 'lodash'; +import { cloneDeep, SCRIPT_REGEX } from '@rsbuild/shared'; import { applyUserBabelConfig, type BabelConfig } from './helper'; import type { PluginBabelOptions } from './types'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42a0d30f2e..df1416f29f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1095,9 +1095,6 @@ importers: babel-loader: specifier: 9.1.3 version: 9.1.3(@babel/core@7.23.2)(webpack@5.89.0) - lodash: - specifier: ^4.17.21 - version: 4.17.21 upath: specifier: 2.0.1 version: 2.0.1 @@ -1108,9 +1105,6 @@ importers: '@rsbuild/test-helper': specifier: workspace:* version: link:../test-helper - '@types/lodash': - specifier: ^4.14.200 - version: 4.14.200 '@types/node': specifier: ^16 version: 16.18.59