From 199a76df893c3695ef395a544246dc9d1149ce60 Mon Sep 17 00:00:00 2001 From: xfsnowind Date: Mon, 13 Apr 2026 15:10:20 +0800 Subject: [PATCH] fix: #49 fix the bug of split chunks algorithm with rspack 2 update tests --- dist/makeDefaultRspackConfig.js | 2 +- src/makeDefaultRspackConfig.ts | 2 +- test/makeDefaultRspackConfig.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/makeDefaultRspackConfig.js b/dist/makeDefaultRspackConfig.js index ad46e60..8122d6d 100644 --- a/dist/makeDefaultRspackConfig.js +++ b/dist/makeDefaultRspackConfig.js @@ -15,7 +15,7 @@ function makeCypressRspackConfig(config) { // rspack does not recognize the sideEffects flag in the package.json and thus files are not unintentionally // dropped during testing in production mode. sideEffects: false, - splitChunks: { chunks: 'all' }, + splitChunks: false, }; const publicPath = path_1.default.sep === posixSeparator ? path_1.default.join(devServerPublicPathRoute, posixSeparator) diff --git a/src/makeDefaultRspackConfig.ts b/src/makeDefaultRspackConfig.ts index e707c95..613b613 100644 --- a/src/makeDefaultRspackConfig.ts +++ b/src/makeDefaultRspackConfig.ts @@ -31,7 +31,7 @@ export function makeCypressRspackConfig(config: CreateFinalRspackConfig): Config // rspack does not recognize the sideEffects flag in the package.json and thus files are not unintentionally // dropped during testing in production mode. sideEffects: false, - splitChunks: { chunks: 'all' }, + splitChunks: false, } const publicPath = diff --git a/test/makeDefaultRspackConfig.spec.ts b/test/makeDefaultRspackConfig.spec.ts index f2ead23..10d76af 100644 --- a/test/makeDefaultRspackConfig.spec.ts +++ b/test/makeDefaultRspackConfig.spec.ts @@ -40,7 +40,7 @@ describe('makeCypressRspackConfig', () => { expect(result.mode).toBe('development') expect(result.optimization).toEqual({ sideEffects: false, - splitChunks: { chunks: 'all' }, + splitChunks: false, }) expect(result.plugins).toMatchSnapshot() expect(result.devtool).toBe('inline-source-map')