Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(uni-builder): modernjs should extend "ua" type in output.polyfill #5642

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/famous-years-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modern-js/uni-builder': patch
---

fix(uni-builder): modernjs should extend "ua" type in output.polyfill
6 changes: 5 additions & 1 deletion packages/cli/uni-builder/src/shared/parseCommonConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export async function parseCommonConfig(
disableSourceMap,
convertToRem,
disableMinimize,
polyfill,
...outputConfig
} = {},
html: {
Expand Down Expand Up @@ -162,7 +163,10 @@ export async function parseCommonConfig(

const rsbuildConfig: RsbuildConfig = {
plugins,
output: outputConfig,
output: {
polyfill: polyfill === 'ua' ? 'off' : polyfill,
...outputConfig,
},
source: {
alias: alias as unknown as SourceConfig['alias'],
...sourceConfig,
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/uni-builder/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
RsbuildPluginAPI,
ArrayOrNot,
HtmlTagDescriptor,
Polyfill,
} from '@rsbuild/shared';
import type { RsbuildConfig } from '@rsbuild/core';
import type { PluginAssetsRetryOptions } from '@rsbuild/plugin-assets-retry';
Expand Down Expand Up @@ -380,7 +381,9 @@ export type UniBuilderPlugin = {
export type UniBuilderConfig = {
dev?: RsbuildConfig['dev'];
html?: RsbuildConfig['html'];
output?: RsbuildConfig['output'];
output?: Omit<NonNullable<RsbuildConfig['output']>, 'polyfill'> & {
chenjiahan marked this conversation as resolved.
Show resolved Hide resolved
polyfill?: Polyfill | 'ua';
};
performance?: RsbuildConfig['performance'];
security?: RsbuildConfig['security'];
tools?: RsbuildConfig['tools'];
Expand Down
Loading