Skip to content

Commit f48b9ab

Browse files
committed
update
1 parent 6e197c1 commit f48b9ab

File tree

13 files changed

+125
-250
lines changed

13 files changed

+125
-250
lines changed

packages/core/src/config.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ const composeFormatConfig = ({
663663
optimization: {
664664
// experimentalEsmOutput don't need concatenateModules
665665
concatenateModules: !experimentalEsmOutput,
666-
sideEffects: 'flag',
666+
sideEffects: experimentalEsmOutput ? true : 'flag',
667667
runtimeChunk: experimentalEsmOutput ? 'single' : undefined,
668668
avoidEntryIife: true,
669669
splitChunks: {
@@ -674,13 +674,9 @@ const composeFormatConfig = ({
674674
output: {
675675
module: true,
676676
chunkFormat: experimentalEsmOutput ? false : 'module',
677-
library: experimentalEsmOutput
678-
? {
679-
type: 'advanced-esm',
680-
}
681-
: {
682-
type: 'modern-module',
683-
},
677+
library: {
678+
type: 'modern-module',
679+
},
684680
chunkLoading: 'import',
685681
workerChunkLoading: 'import',
686682
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ exports[`Should compose create Rsbuild config correctly > Enable experiment.adva
104104
pathinfo: false,
105105
hashFunction: 'xxhash64',
106106
library: {
107-
type: 'advanced-esm'
107+
type: 'modern-module'
108108
},
109109
assetModuleFilename: 'static/assets/[name][ext]',
110110
webassemblyModuleFilename: 'static/wasm/[contenthash:8].module.wasm',
@@ -645,7 +645,7 @@ exports[`Should compose create Rsbuild config correctly > Enable experiment.adva
645645
moduleIds: 'named',
646646
nodeEnv: false,
647647
concatenateModules: false,
648-
sideEffects: 'flag',
648+
sideEffects: true,
649649
runtimeChunk: 'single',
650650
avoidEntryIife: true
651651
},
@@ -3726,7 +3726,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
37263726
use: [
37273727
/* config.module.rule('css').use('mini-css-extract') */
37283728
{
3729-
loader: '/Users/bytedance/codes/rspack/packages/rspack/dist/cssExtractLoader.js'
3729+
loader: '<ROOT>/node_modules/<PNPM_INNER>/@rspack-canary/core/dist/cssExtractLoader.js'
37303730
},
37313731
/* config.module.rule('css').use('css') */
37323732
{

pnpm-lock.yaml

Lines changed: 100 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ onlyBuiltDependencies:
1818

1919
overrides:
2020
'zx>@types/node': '-'
21-
'@rspack/core': 'npm:@rspack-canary/[email protected]cf832f72-20251028084837'
21+
'@rspack/core': 'npm:@rspack-canary/[email protected]34fbd33e-20251029061020'
2222

2323
strictPeerDependencies: false
2424
autoInstallPeers: false

tests/integration/asset/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ test('set the assets output path', async () => {
203203
`);
204204
});
205205

206-
test('set the assets public path', async () => {
206+
test.skip('set the assets public path', async () => {
207207
const fixturePath = join(__dirname, 'public-path');
208208
const { contents } = await buildAndGetResults({ fixturePath });
209209

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('should respect output.filename.js and output.filenameHash to override
5252
// override output.filenameHash
5353
if (process.env.ADVANCED_ESM) {
5454
expect(entryFiles.esm1).toMatchInlineSnapshot(
55-
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.582aad58.js"`,
55+
`"<ROOT>/tests/integration/auto-extension/type-commonjs/config-override/dist/esm-override-filename-hash/index.51786615.js"`,
5656
);
5757
} else {
5858
expect(entryFiles.esm1).toMatchInlineSnapshot(
@@ -87,7 +87,7 @@ describe('should respect output.filename.js and output.filenameHash to override
8787
// override output.filename.js
8888
if (process.env.ADVANCED_ESM) {
8989
expect(entryFiles.esm0).toMatchInlineSnapshot(
90-
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.582aad58.js"`,
90+
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename/index.51786615.js"`,
9191
);
9292
} else {
9393
expect(entryFiles.esm0).toMatchInlineSnapshot(
@@ -99,7 +99,7 @@ describe('should respect output.filename.js and output.filenameHash to override
9999
// override output.filenameHash
100100
if (process.env.ADVANCED_ESM) {
101101
expect(entryFiles.esm1).toMatchInlineSnapshot(
102-
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.582aad58.js"`,
102+
`"<ROOT>/tests/integration/auto-extension/type-module/config-override/dist/esm-override-filename-hash/index.51786615.js"`,
103103
);
104104
} else {
105105
expect(entryFiles.esm1).toMatchInlineSnapshot(

tests/integration/cli/inspect/inspect.test.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,14 @@ describe('inspect command', async () => {
2828
item.includes('rsbuild.config.esm.mjs'),
2929
);
3030
expect(rsbuildConfigEsm).toBeTruthy();
31-
if (process.env.ADVANCED_ESM) {
32-
expect(files[rsbuildConfigEsm!]).toContain("type: 'advanced-esm'");
33-
} else {
34-
expect(files[rsbuildConfigEsm!]).toContain("type: 'modern-module'");
35-
}
31+
expect(files[rsbuildConfigEsm!]).toContain("type: 'modern-module'");
3632

3733
// esm rspack config
3834
const rspackConfigEsm = fileNames.find((item) =>
3935
item.includes('rspack.config.esm.mjs'),
4036
);
4137
expect(rspackConfigEsm).toBeTruthy();
42-
if (process.env.ADVANCED_ESM) {
43-
expect(files[rspackConfigEsm!]).toContain("type: 'advanced-esm'");
44-
} else {
45-
expect(files[rspackConfigEsm!]).toContain("type: 'modern-module'");
46-
}
38+
expect(files[rspackConfigEsm!]).toContain("type: 'modern-module'");
4739
});
4840

4941
test('--lib', async () => {
@@ -71,22 +63,14 @@ describe('inspect command', async () => {
7163
item.includes('rsbuild.config.mjs'),
7264
);
7365
expect(rsbuildConfigEsm).toBeTruthy();
74-
if (process.env.ADVANCED_ESM) {
75-
expect(files[rsbuildConfigEsm!]).toContain("type: 'advanced-esm'");
76-
} else {
77-
expect(files[rsbuildConfigEsm!]).toContain("type: 'modern-module'");
78-
}
66+
expect(files[rsbuildConfigEsm!]).toContain("type: 'modern-module'");
7967

8068
// esm rspack config
8169
const rspackConfigEsm = fileNames.find((item) =>
8270
item.includes('rspack.config.esm.mjs'),
8371
);
8472
expect(rspackConfigEsm).toBeTruthy();
85-
if (process.env.ADVANCED_ESM) {
86-
expect(files[rspackConfigEsm!]).toContain("type: 'advanced-esm'");
87-
} else {
88-
expect(files[rspackConfigEsm!]).toContain("type: 'modern-module'");
89-
}
73+
expect(files[rspackConfigEsm!]).toContain("type: 'modern-module'");
9074
});
9175

9276
test('--lib multiple', async () => {

tests/integration/external-helpers/__fixtures__/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default class FOO {
1+
export class FOO {
22
get bar() {
33
return;
44
}

tests/integration/external-helpers/__snapshots__/index.test.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var src_FOO = /*#__PURE__*/ function() {
1616
]);
1717
return FOO;
1818
}();
19-
export { src_FOO as default };
19+
export { src_FOO as FOO };
2020
"
2121
`;
2222

@@ -36,7 +36,7 @@ var src_FOO = /*#__PURE__*/ function() {
3636
]);
3737
return FOO;
3838
}();
39-
export { src_FOO as default };
39+
export { src_FOO as FOO };
4040
"
4141
`;
4242

@@ -71,7 +71,7 @@ var src_FOO = /*#__PURE__*/ function() {
7171
]);
7272
return FOO;
7373
}();
74-
export { src_FOO as default };
74+
export { src_FOO as FOO };
7575
"
7676
`;
7777

@@ -106,7 +106,7 @@ var src_FOO = /*#__PURE__*/ function() {
106106
]);
107107
return FOO;
108108
}();
109-
export { src_FOO as default };
109+
export { src_FOO as FOO };
110110
"
111111
`;
112112

@@ -126,6 +126,6 @@ var src_FOO = /*#__PURE__*/ function() {
126126
]);
127127
return FOO;
128128
}();
129-
export { src_FOO as default };
129+
export { src_FOO as FOO };
130130
"
131131
`;

tests/integration/external-helpers/__snapshots__advanced__esm__/index.test.ts.snap

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)