diff --git a/.changeset/early-bats-remain.md b/.changeset/early-bats-remain.md new file mode 100644 index 000000000000..6e0438c60643 --- /dev/null +++ b/.changeset/early-bats-remain.md @@ -0,0 +1,7 @@ +--- +'@modern-js/plugin-v2': patch +--- + +feat: use assign to update context + +feat: 使用 assign 函数更新 context 信息 diff --git a/packages/toolkit/plugin-v2/src/cli/api.ts b/packages/toolkit/plugin-v2/src/cli/api.ts index 42aca45ea84f..a8b39cd84db2 100644 --- a/packages/toolkit/plugin-v2/src/cli/api.ts +++ b/packages/toolkit/plugin-v2/src/cli/api.ts @@ -1,5 +1,4 @@ -import { merge } from '@modern-js/utils/lodash'; -import { modifyBundlerChain } from '@rsbuild/core/dist-types/configChain'; +import { assign } from '@modern-js/utils/lodash'; import type { PluginHook } from '../types'; import type { AllKeysForCLIPluginExtendsAPI, @@ -76,7 +75,7 @@ export function initPluginAPI({ } function updateAppContext(updateContext: DeepPartial>) { - context = merge(context, updateContext); + context = assign(context, updateContext); } const pluginAPI = {