Skip to content

Commit

Permalink
fix(uni-builder): make the plugins type looser to avoid type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy committed Jan 12, 2024
1 parent d6fa948 commit ec02d39
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 48 deletions.
7 changes: 7 additions & 0 deletions .changeset/tough-avocados-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/uni-builder': patch
---

fix(uni-builder): make the plugins type looser to avoid type mismatch

fix(uni-builder): 使用更松散的 plugins 类型来避免 type 不匹配的问题
5 changes: 4 additions & 1 deletion packages/builder/uni-builder/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,11 @@ export type UniBuilderContext = RsbuildPluginAPI['context'] & {
entry: Record<string, string | string[]>;
};

/**
* make the plugins type looser to avoid type mismatch
*/
export type UniBuilderPluginAPI = {
[key in keyof RsbuildPluginAPI]: RsbuildPluginAPI[key];
[key in keyof RsbuildPluginAPI]: any;
} & {
/** The following APIs only type incompatibility */
onBeforeCreateCompiler: (fn: any) => void;
Expand Down
Loading

0 comments on commit ec02d39

Please sign in to comment.