Skip to content

Commit

Permalink
fix(minify): only preserve some comments and annotations by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Dec 12, 2024
1 parent aa4c5f3 commit 10fb850
Show file tree
Hide file tree
Showing 30 changed files with 297 additions and 226 deletions.
2 changes: 1 addition & 1 deletion examples/module-federation/mf-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@module-federation/rsbuild-plugin": "^0.8.1",
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.1.0",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/module-federation/mf-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@module-federation/rsbuild-plugin": "^0.8.1",
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.1.0",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"prebundle": "prebundle"
},
"dependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"rsbuild-plugin-dts": "workspace:*",
"tinyglobby": "^0.2.10"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ export function composeMinifyConfig(config: LibConfig): RsbuildConfig {
toplevel: format !== 'mf',
},
format: {
comments: 'all',
comments: 'some',
preserve_annotations: true,
},
},
},
Expand Down
9 changes: 6 additions & 3 deletions packages/core/tests/__snapshots__/config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
"unused": true,
},
"format": {
"comments": "all",
"comments": "some",
"preserve_annotations": true,
},
"mangle": false,
"minify": false,
Expand Down Expand Up @@ -327,7 +328,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
"unused": true,
},
"format": {
"comments": "all",
"comments": "some",
"preserve_annotations": true,
},
"mangle": false,
"minify": false,
Expand Down Expand Up @@ -557,7 +559,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
"unused": true,
},
"format": {
"comments": "all",
"comments": "some",
"preserve_annotations": true,
},
"mangle": false,
"minify": false,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ describe('minify', () => {
"unused": true,
},
"format": {
"comments": "all",
"comments": "some",
"preserve_annotations": true,
},
"mangle": false,
"minify": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"storybook": "storybook dev"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"storybook": "storybook dev"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "vitest run"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.0.7",
"@rslib/core": "workspace:*",
"@storybook/addon-essentials": "^8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test": "vitest run"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.0.7",
"@rslib/core": "workspace:*",
"@storybook/addon-essentials": "^8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"storybook": "storybook dev"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.0.7",
"@rslib/core": "workspace:*",
"@storybook/addon-essentials": "^8.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"storybook": "storybook dev"
},
"devDependencies": {
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rsbuild/plugin-react": "^1.0.7",
"@rslib/core": "workspace:*",
"@storybook/addon-essentials": "^8.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-dts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "^7.48.0",
"@rsbuild/core": "~1.1.9",
"@rsbuild/core": "~1.1.10",
"@rslib/tsconfig": "workspace:*",
"rslib": "npm:@rslib/[email protected]",
"typescript": "^5.6.3"
Expand Down
Loading

0 comments on commit 10fb850

Please sign in to comment.