-
-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Details
Since Rslib have a configuration named syntax, when users specify syntax, it has a higher priority than .browserslistrc. And when users do not specify syntax, the default value will be esnext which will override the browsers list to last 1 versions of browsers.
See
rslib/packages/core/src/config.ts
Lines 953 to 983 in 45f1660
| const composeSyntaxConfig = ( | |
| target: RsbuildConfigOutputTarget, | |
| syntax?: Syntax, | |
| ): EnvironmentConfig => { | |
| // Defaults to ESNext, Rslib will assume all of the latest JavaScript and CSS features are supported. | |
| if (syntax) { | |
| return { | |
| tools: { | |
| rspack: (config) => { | |
| config.target = transformSyntaxToRspackTarget(syntax); | |
| }, | |
| }, | |
| output: { | |
| overrideBrowserslist: transformSyntaxToBrowserslist(syntax, target), | |
| }, | |
| }; | |
| } | |
| return { | |
| tools: { | |
| rspack: (config) => { | |
| config.target = ['es2022']; | |
| return config; | |
| }, | |
| }, | |
| output: { | |
| // If `syntax` is not defined, Rslib will try to determine by the `target`, with the last version of the target. | |
| overrideBrowserslist: ESX_TO_BROWSERSLIST.esnext(target), | |
| }, | |
| }; | |
| }; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels