Skip to content

Commit

Permalink
👷‍♀️ [RUM-6424] Change webpack chunk config to speed up local unit te…
Browse files Browse the repository at this point in the history
…sts (#3057)

* 👷‍♀️ Remove split Chunk false for webpack

* 👷‍♀️ only remove splitChunk with scope  command

* Remove splitchunk by default locally

* remove `splitChunks` everywhere

Somehow, even if we exclude `developer-extension` sources in
browser-stack karma configuration, they still end up in the bundle. In
those sources, we used a Regexp syntax unsupported in older browsers.

This commit work around this issue by using the `new RegExp` constructor
instead of the regexp syntax.

---------

Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
  • Loading branch information
cy-moi and BenoitZugmeyer authored Nov 5, 2024
1 parent 1a4b01c commit 560f28e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function filterOutdatedVersions(events: SdkEvent[]): SdkEvent[] {

export function parseQuery(query: string) {
const queryParts = query
.split(/(?<!\\)\s/g) // Hack it to escape whitespace with backslashes
.split(new RegExp('(?<!\\\\)\\s', 'g')) // Hack it to escape whitespace with backslashes. Use a regex constructor to avoid syntax errors in older browsers
.filter((queryPart) => queryPart)
.map((queryPart) => queryPart.split(':'))

Expand Down
1 change: 0 additions & 1 deletion test/unit/karma.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module.exports = {
// with all dependencies shared. Our test suite does not support sharing dependencies, each
// spec bundle should include its own copy of dependencies.
runtimeChunk: false,
splitChunks: false,
},
ignoreWarnings: [
// we will see warnings about missing exports in some files
Expand Down

0 comments on commit 560f28e

Please sign in to comment.