Skip to content

Commit 1582248

Browse files
committed
feat!(create): upgrade default browser targets
See discussion in web-infra-dev/rspack#10290 for info
1 parent 86a66a8 commit 1582248

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

packages/cli/uni-builder/src/shared/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const getHash = (config: NormalizedEnvironmentConfig) => {
128128
return filenameHash ? '.[contenthash:8]' : '';
129129
};
130130

131+
// TODO(@vegerot): update this to `['defaults']` for next breaking change release
131132
const DEFAULT_WEB_BROWSERSLIST = ['> 0.01%', 'not dead', 'not op_mini all'];
132133

133134
const DEFAULT_BROWSERSLIST: Record<RsbuildTarget, string[]> = {

packages/document/main-doc/docs/en/guides/advanced-features/page-performance/optimize-bundle.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,12 @@ See the [performance.bundleAnalyze](/configure/app/performance/bundle-analyze.ht
4646

4747
Modern.js will compile the code according to the project's Browserslist config, and inject some Polyfills. If the project does not need to be compatible with legacy browsers, you can adjust the Browserslist and drop some legacy browsers, thereby reducing the compilation overhead on syntax and polyfill.
4848

49-
Modern.js's default Browserslist config is:
49+
Modern.js's projects are created with the [default](https://github.com/browserslist/browserslist/blob/7b0ff670e997c53b13d44e2150ab09807a20ed6b/index.js#L477) Browserslist config.
5050

51-
```js
52-
['> 0.01%', 'not dead', 'not op_mini all'];
53-
```
54-
55-
For example, if you only need to be compatible with browsers above Chrome 61, you can change it to:
51+
For example, if you only need to be compatible with the latest Chrome versions, you can change it to:
5652

5753
```js
58-
['Chrome >= 61'];
54+
['last 2 chrome versions'];
5955
```
6056

6157
:::tip
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
chrome >= 51
2-
edge >= 15
3-
firefox >= 54
4-
safari >= 10
5-
ios_saf >= 10
1+
# > 0.5%, last 2 versions, Firefox ESR, not dead
2+
3+
defaults

packages/toolkit/utils/src/cli/get/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const getAntdMajorVersion = (appDirectory: string) => {
5555
}
5656
};
5757

58+
// TODO(@vegerot): update this to `['defaults']` for next breaking change release
5859
export const defaults = ['> 0.01%', 'not dead', 'not op_mini all'];
5960

6061
export const getBrowserslist = (appDirectory: string) =>

0 commit comments

Comments
 (0)