Skip to content

Commit

Permalink
Merge pull request #1060 from ckeditor/disable-tree-shaking-in-tests
Browse files Browse the repository at this point in the history
Fix (tests): Disable tree-shaking in webpack. See ckeditor/ckeditor5#17767.
  • Loading branch information
psmyrek authored Jan 23, 2025
2 parents 828a105 + 54250ff commit 0afe20b
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ export default function getWebpackConfigForAutomatedTests( options ) {
new webpack.ProvidePlugin( {
Buffer: [ 'buffer', 'Buffer' ],
process: 'process/browser.js'
} )
} ),

/**
* 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.
*/
{
apply( compiler ) {
compiler.options.optimization = {
...compiler.options.optimization,
sideEffects: false
};
}
}
],

resolve: {
Expand Down Expand Up @@ -88,6 +102,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
};
Expand Down

0 comments on commit 0afe20b

Please sign in to comment.