Skip to content

Commit bca4bb1

Browse files
committed
Revert "revert some to all"
This reverts commit d679b29.
1 parent d679b29 commit bca4bb1

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

packages/core/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export function composeMinifyConfig(config: LibConfig): RsbuildConfig {
339339
toplevel: format !== 'mf',
340340
},
341341
format: {
342-
comments: 'all',
342+
comments: 'some',
343343
preserve_annotations: true,
344344
},
345345
},

tests/integration/minify/index.test.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ describe('minify config', () => {
77
const fixturePath = join(__dirname, 'default');
88
const { entries } = await buildAndGetResults({ fixturePath });
99
expect(entries.esm).toMatchInlineSnapshot(`
10-
"/*! For license information please see index.js.LICENSE.txt */
11-
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
12-
/*! Legal Comment */ const foo = ()=>{};
13-
// normal comment
14-
const Button = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)('button', {});
15-
export { Button, foo };
16-
"
17-
`);
10+
"/*! For license information please see index.js.LICENSE.txt */
11+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
12+
/*! Legal Comment */ const foo = ()=>{};
13+
const Button = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)('button', {});
14+
export { Button, foo };
15+
"
16+
`);
1817
});
1918

2019
test('minify is disabled, nothing will be stripped', async () => {
@@ -56,10 +55,9 @@ describe('minify config (mf)', () => {
5655
const { mfExposeEntry } = await buildAndGetResults({ fixturePath });
5756
// biome-ignore format: snapshot
5857
expect(mfExposeEntry).toMatchInlineSnapshot(`
59-
"/*! For license information please see __federation_expose_default_export.js.LICENSE.txt */
60-
"use strict";(globalThis["default_minify"]=globalThis["default_minify"]||[]).push([["249"],{163:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Button:function(){return Button},foo:function(){return foo}});/* ESM import */var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(37);/*! Legal Comment */const foo=()=>{};// normal comment
61-
const Button=()=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button",{})}}]);"
62-
`);
58+
"/*! For license information please see __federation_expose_default_export.js.LICENSE.txt */
59+
"use strict";(globalThis["default_minify"]=globalThis["default_minify"]||[]).push([["249"],{163:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Button:function(){return Button},foo:function(){return foo}});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(37);/*! Legal Comment */const foo=()=>{};const Button=()=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button",{})}}]);"
60+
`);
6361
});
6462

6563
test('minify is disabled by the user, nothing not be stripped', async () => {

0 commit comments

Comments
 (0)