Skip to content

Commit f936950

Browse files
committed
chore: update
1 parent cd8d618 commit f936950

File tree

8 files changed

+39
-37
lines changed

8 files changed

+39
-37
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
313313
experiments: {
314314
lazyBarrel: true,
315315
inlineEnum: true,
316-
inlineConst: false,
316+
inlineConst: true,
317317
typeReexportsPresence: true,
318318
rspackFuture: {
319319
bundlerInfo: {
@@ -456,8 +456,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
456456
module: {
457457
parser: {
458458
javascript: {
459-
inlineConst: false,
460459
exportsPresence: 'error',
460+
inlineConst: true,
461461
typeReexportsPresence: 'tolerant',
462462
importMeta: false,
463463
importDynamic: false,
@@ -1012,7 +1012,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
10121012
experiments: {
10131013
lazyBarrel: true,
10141014
inlineEnum: true,
1015-
inlineConst: false,
1015+
inlineConst: true,
10161016
typeReexportsPresence: true,
10171017
rspackFuture: {
10181018
bundlerInfo: {
@@ -1153,8 +1153,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
11531153
module: {
11541154
parser: {
11551155
javascript: {
1156-
inlineConst: false,
11571156
exportsPresence: 'error',
1157+
inlineConst: true,
11581158
typeReexportsPresence: 'tolerant',
11591159
importMeta: false,
11601160
importDynamic: false,
@@ -1705,7 +1705,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
17051705
experiments: {
17061706
lazyBarrel: true,
17071707
inlineEnum: true,
1708-
inlineConst: false,
1708+
inlineConst: true,
17091709
typeReexportsPresence: true,
17101710
rspackFuture: {
17111711
bundlerInfo: {
@@ -1835,8 +1835,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
18351835
module: {
18361836
parser: {
18371837
javascript: {
1838-
inlineConst: false,
18391838
exportsPresence: 'error',
1839+
inlineConst: true,
18401840
typeReexportsPresence: 'tolerant',
18411841
importMeta: false
18421842
}
@@ -2306,7 +2306,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
23062306
experiments: {
23072307
lazyBarrel: true,
23082308
inlineEnum: true,
2309-
inlineConst: false,
2309+
inlineConst: true,
23102310
typeReexportsPresence: true,
23112311
rspackFuture: {
23122312
bundlerInfo: {
@@ -2438,8 +2438,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
24382438
module: {
24392439
parser: {
24402440
javascript: {
2441-
inlineConst: false,
24422441
exportsPresence: 'error',
2442+
inlineConst: true,
24432443
typeReexportsPresence: 'tolerant',
24442444
importMeta: false
24452445
}
@@ -2908,7 +2908,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
29082908
experiments: {
29092909
lazyBarrel: true,
29102910
inlineEnum: true,
2911-
inlineConst: false,
2911+
inlineConst: true,
29122912
typeReexportsPresence: true,
29132913
rspackFuture: {
29142914
bundlerInfo: {
@@ -2977,8 +2977,8 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
29772977
module: {
29782978
parser: {
29792979
javascript: {
2980-
inlineConst: false,
29812980
exportsPresence: 'error',
2981+
inlineConst: true,
29822982
typeReexportsPresence: 'tolerant'
29832983
}
29842984
},

tests/integration/auto-extension/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ describe('should respect output.filename.js and output.filenameHash to override
4646
// override output.filename.js
4747
expect(extname(entryFiles.esm0!)).toEqual('.mjs');
4848
expect(entryFiles.cjs0).toMatchInlineSnapshot(
49-
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/cjs-override-filename/index.df02628a.js"`,
49+
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/cjs-override-filename/index.c8a12fd0.js"`,
5050
);
5151

5252
// override output.filenameHash
5353
expect(entryFiles.esm1).toMatchInlineSnapshot(
54-
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.996a7edd.js"`,
54+
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.b4545719.js"`,
5555
);
5656
expect(entryFiles.cjs1).toMatchInlineSnapshot(
57-
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/cjs-override-filename-hash/index.df02628a.js"`,
57+
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/cjs-override-filename-hash/index.c8a12fd0.js"`,
5858
);
5959

6060
// override different file types with function
@@ -80,16 +80,16 @@ describe('should respect output.filename.js and output.filenameHash to override
8080

8181
// override output.filename.js
8282
expect(entryFiles.esm0).toMatchInlineSnapshot(
83-
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.996a7edd.js"`,
83+
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.b4545719.js"`,
8484
);
8585
expect(extname(entryFiles.cjs0!)).toEqual('.cjs');
8686

8787
// override output.filenameHash
8888
expect(entryFiles.esm1).toMatchInlineSnapshot(
89-
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.996a7edd.js"`,
89+
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.b4545719.js"`,
9090
);
9191
expect(entryFiles.cjs1).toMatchInlineSnapshot(
92-
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/cjs-override-filename-hash/index.df02628a.js"`,
92+
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/cjs-override-filename-hash/index.c8a12fd0.js"`,
9393
);
9494

9595
// override different file types with function

tests/integration/entry/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ test('multiple entry bundle', async () => {
6767
});
6868
// cspell:disable
6969
expect(index).toMatchInlineSnapshot(`
70-
"const shared = 'shared';
71-
const foo = 'foo' + shared;
72-
const src_text = ()=>\`hello \${foo} \${shared}\`;
70+
"const foo = "fooshared";
71+
const src_text = ()=>\`hello \${foo} shared\`;
7372
export { src_text as text };
7473
"
7574
`);
@@ -80,8 +79,7 @@ test('multiple entry bundle', async () => {
8079
});
8180
// cspell:disable
8281
expect(foo).toMatchInlineSnapshot(`
83-
"const shared = 'shared';
84-
const foo = 'foo' + shared;
82+
"const foo = "fooshared";
8583
export { foo };
8684
"
8785
`);

tests/integration/extension-alias/__snapshots__/index.test.ts.snap

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22

33
exports[`resolve.extensionAlias should work 1`] = `
44
""use strict";
5+
var __webpack_require__ = {};
6+
(()=>{
7+
__webpack_require__.r = (exports1)=>{
8+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
9+
value: 'Module'
10+
});
11+
Object.defineProperty(exports1, '__esModule', {
12+
value: true
13+
});
14+
};
15+
})();
516
var __webpack_exports__ = {};
6-
const bar = 'bar';
7-
const foo = 'foo';
8-
console.log(foo + bar);
17+
__webpack_require__.r(__webpack_exports__);
18+
console.log("foobar");
919
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1020
Object.defineProperty(exports, '__esModule', {
1121
value: true
@@ -14,8 +24,6 @@ Object.defineProperty(exports, '__esModule', {
1424
`;
1525

1626
exports[`resolve.extensionAlias should work 2`] = `
17-
"const bar = 'bar';
18-
const foo = 'foo';
19-
console.log(foo + bar);
27+
"console.log("foobar");
2028
"
2129
`;

tests/integration/externals/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ test('user externals', async () => {
9696
"import node_fs from "node:fs";
9797
import lodash from "lodash";
9898
import zip from "lodash/zip";
99-
const foo = 'foo';
100-
console.log(node_fs, lodash.add, zip, foo);
99+
console.log(node_fs, lodash.add, zip, "foo");
101100
"
102101
`,
103102
);

tests/integration/format/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ test('format default to esm', async () => {
3030
// cspell:disable
3131
expect(contents.esm0).toMatchInlineSnapshot(`
3232
{
33-
"<ROOT>/tests/integration/format/default/dist/bundle-esm/index.js": "const foo = 'foo';
34-
const str = 'hello' + foo + ' world';
33+
"<ROOT>/tests/integration/format/default/dist/bundle-esm/index.js": "const str = "hellofoo world";
3534
export { str };
3635
",
3736
}

tests/integration/resolve/index.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ test('resolve with js extensions', async () => {
6363

6464
expect(isSuccess).toBeTruthy();
6565
expect(entries.esm).toMatchInlineSnapshot(`
66-
"const value = 1;
67-
console.log(value);
66+
"console.log(1);
6867
"
6968
`);
7069
});
@@ -76,8 +75,7 @@ test('resolve with main fields', async () => {
7675

7776
expect(isSuccess).toBeTruthy();
7877
expect(Object.values(results[0]!)[0]).toMatchInlineSnapshot(`
79-
"const value = 1;
80-
console.log(value);
78+
"console.log(1);
8179
"
8280
`);
8381
expect(Object.values(results[1]!)[0]).toContain('main');

tests/integration/tsconfig/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ test('tsconfig path', async () => {
66
const { isSuccess, entries } = await buildAndGetResults({ fixturePath });
77

88
expect(isSuccess).toBe(true);
9-
expect(entries.esm).toContain(`const foo = 'foo'`);
10-
expect(entries.cjs).toContain(`const foo = 'foo'`);
9+
expect(entries.esm).toContain(`console.info("foo")`);
10+
expect(entries.cjs).toContain(`console.info("foo")`);
1111
});

0 commit comments

Comments
 (0)