-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
👷♀️ [RUM-6424] Change webpack chunk config to speed up local unit tests #3057
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3057 +/- ##
==========================================
- Coverage 93.67% 93.66% -0.02%
==========================================
Files 275 275
Lines 7610 7610
Branches 1707 1707
==========================================
- Hits 7129 7128 -1
- Misses 481 482 +1 ☔ View full report in Codecov by Sentry. |
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
f22c9c7
to
76c8a40
Compare
test/unit/karma.local.conf.js
Outdated
@@ -18,6 +18,7 @@ module.exports = function (config) { | |||
}, | |||
webpack: { | |||
...karmaBaseConf.webpack, | |||
optimization: { runtimeChunk: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we only doing it for local unit tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we run multiple times consecutively for cicd with watch
option. This only speeds it up when we want to watch
changes. BrowserStack unit tests would fail without splitChunk:false
.
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.
Same as the developer-extension, |
Motivation
Running unit tests locally is slow because we build dependency bundles with every change. We should speed it up to improve the development experience.
Webpack automatically split chunks so not all chunks will be rebuilt. Currently we set it to false due to dependency issues between our bundles. But we don't need to rebuild everything all the time.
Changes
Add a 'scope' command to avoid rebuilding all bundles when running scoped unit tests.
Testing
I have gone over the contributing documentation.