Skip to content

Commit 10fb850

Browse files
committed
fix(minify): only preserve some comments and annotations by default
1 parent aa4c5f3 commit 10fb850

File tree

30 files changed

+297
-226
lines changed

30 files changed

+297
-226
lines changed

examples/module-federation/mf-host/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"@module-federation/rsbuild-plugin": "^0.8.1",
16-
"@rsbuild/core": "~1.1.9",
16+
"@rsbuild/core": "~1.1.10",
1717
"@rsbuild/plugin-react": "^1.1.0",
1818
"@types/react": "^19.0.1",
1919
"@types/react-dom": "^19.0.2",

examples/module-federation/mf-remote/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"@module-federation/rsbuild-plugin": "^0.8.1",
16-
"@rsbuild/core": "~1.1.9",
16+
"@rsbuild/core": "~1.1.10",
1717
"@rsbuild/plugin-react": "^1.1.0",
1818
"@types/react": "^19.0.1",
1919
"@types/react-dom": "^19.0.2",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"prebundle": "prebundle"
3838
},
3939
"dependencies": {
40-
"@rsbuild/core": "~1.1.9",
40+
"@rsbuild/core": "~1.1.10",
4141
"rsbuild-plugin-dts": "workspace:*",
4242
"tinyglobby": "^0.2.10"
4343
},

packages/core/src/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ export function composeMinifyConfig(config: LibConfig): RsbuildConfig {
339339
toplevel: format !== 'mf',
340340
},
341341
format: {
342-
comments: 'all',
342+
comments: 'some',
343+
preserve_annotations: true,
343344
},
344345
},
345346
},

packages/core/tests/__snapshots__/config.test.ts.snap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
9090
"unused": true,
9191
},
9292
"format": {
93-
"comments": "all",
93+
"comments": "some",
94+
"preserve_annotations": true,
9495
},
9596
"mangle": false,
9697
"minify": false,
@@ -327,7 +328,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
327328
"unused": true,
328329
},
329330
"format": {
330-
"comments": "all",
331+
"comments": "some",
332+
"preserve_annotations": true,
331333
},
332334
"mangle": false,
333335
"minify": false,
@@ -557,7 +559,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
557559
"unused": true,
558560
},
559561
"format": {
560-
"comments": "all",
562+
"comments": "some",
563+
"preserve_annotations": true,
561564
},
562565
"mangle": false,
563566
"minify": false,

packages/core/tests/config.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ describe('minify', () => {
331331
"unused": true,
332332
},
333333
"format": {
334-
"comments": "all",
334+
"comments": "some",
335+
"preserve_annotations": true,
335336
},
336337
"mangle": false,
337338
"minify": false,

packages/create-rslib/fragments/tools/storybook-react-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"storybook": "storybook dev"
55
},
66
"devDependencies": {
7-
"@rsbuild/core": "~1.1.9",
7+
"@rsbuild/core": "~1.1.10",
88
"@storybook/addon-essentials": "^8.4.7",
99
"@storybook/addon-interactions": "^8.4.7",
1010
"@storybook/addon-links": "^8.4.7",

packages/create-rslib/fragments/tools/storybook-react-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"storybook": "storybook dev"
55
},
66
"devDependencies": {
7-
"@rsbuild/core": "~1.1.9",
7+
"@rsbuild/core": "~1.1.10",
88
"@storybook/addon-essentials": "^8.4.7",
99
"@storybook/addon-interactions": "^8.4.7",
1010
"@storybook/addon-links": "^8.4.7",

packages/create-rslib/template-[react]-[storybook,vitest]-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test": "vitest run"
2020
},
2121
"devDependencies": {
22-
"@rsbuild/core": "~1.1.9",
22+
"@rsbuild/core": "~1.1.10",
2323
"@rsbuild/plugin-react": "^1.0.7",
2424
"@rslib/core": "workspace:*",
2525
"@storybook/addon-essentials": "^8.4.7",

packages/create-rslib/template-[react]-[storybook,vitest]-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test": "vitest run"
2222
},
2323
"devDependencies": {
24-
"@rsbuild/core": "~1.1.9",
24+
"@rsbuild/core": "~1.1.10",
2525
"@rsbuild/plugin-react": "^1.0.7",
2626
"@rslib/core": "workspace:*",
2727
"@storybook/addon-essentials": "^8.4.7",

packages/create-rslib/template-[react]-[storybook]-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"storybook": "storybook dev"
1919
},
2020
"devDependencies": {
21-
"@rsbuild/core": "~1.1.9",
21+
"@rsbuild/core": "~1.1.10",
2222
"@rsbuild/plugin-react": "^1.0.7",
2323
"@rslib/core": "workspace:*",
2424
"@storybook/addon-essentials": "^8.4.7",

packages/create-rslib/template-[react]-[storybook]-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"storybook": "storybook dev"
2121
},
2222
"devDependencies": {
23-
"@rsbuild/core": "~1.1.9",
23+
"@rsbuild/core": "~1.1.10",
2424
"@rsbuild/plugin-react": "^1.0.7",
2525
"@rslib/core": "workspace:*",
2626
"@storybook/addon-essentials": "^8.4.7",

packages/plugin-dts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"@microsoft/api-extractor": "^7.48.0",
38-
"@rsbuild/core": "~1.1.9",
38+
"@rsbuild/core": "~1.1.10",
3939
"@rslib/tsconfig": "workspace:*",
4040
"rslib": "npm:@rslib/[email protected]",
4141
"typescript": "^5.6.3"

0 commit comments

Comments
 (0)