From 8588e600da5ddeff1b9ed103802f11f80933bb02 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 23 Jan 2025 10:15:54 +0100 Subject: [PATCH 1/2] Fix (tests): Disable tree-shaking in webpack. --- .../utils/automated-tests/getwebpackconfig.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js b/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js index 035878f10..eeb4f26e1 100644 --- a/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js +++ b/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js @@ -32,7 +32,22 @@ export default function getWebpackConfigForAutomatedTests( options ) { new webpack.ProvidePlugin( { Buffer: [ 'buffer', 'Buffer' ], process: 'process/browser.js' - } ) + } ), + + /** + * Disable tree-shaking because it remove tests for packages with `sideEffects` field in + * `package.json`. + * + * Workaround for https://github.com/ckeditor/ckeditor5/issues/17767#issuecomment-2598263796. + */ + { + apply( compiler ) { + compiler.options.optimization = { + ...compiler.options.optimization, + sideEffects: false + }; + } + } ], resolve: { @@ -88,6 +103,7 @@ export default function getWebpackConfigForAutomatedTests( options ) { // Since webpack v5 it looks like splitting out the source code into the commons and runtime chunks broke the source map support. config.optimization = { + ...config.optimization, runtimeChunk: false, splitChunks: false }; From 54250ff14ed9491ba2c903dd27530445069d2475 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 23 Jan 2025 10:48:57 +0100 Subject: [PATCH 2/2] Fix typo --- .../lib/utils/automated-tests/getwebpackconfig.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js b/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js index eeb4f26e1..52b344604 100644 --- a/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js +++ b/packages/ckeditor5-dev-tests/lib/utils/automated-tests/getwebpackconfig.js @@ -35,8 +35,7 @@ export default function getWebpackConfigForAutomatedTests( options ) { } ), /** - * Disable tree-shaking because it remove tests for packages with `sideEffects` field in - * `package.json`. + * Disable tree-shaking because it removes tests for packages with `sideEffects` field in `package.json`. * * Workaround for https://github.com/ckeditor/ckeditor5/issues/17767#issuecomment-2598263796. */