-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
target_web
packages should be built as browser-agnostic ES modules
#130904
target_web
packages should be built as browser-agnostic ES modules
#130904
Conversation
webpack_preset
should target ES modulestarget_web
packages should be built as browser-agnostic ES modules
6ed656c
to
9c0b1cb
Compare
💛 Build succeeded, but was flakyTest Failures
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Closing this PR as @spalger confirmed that the above assumption is not true Webpack doesn't apply transforms to support new syntax/features in older browsers, babel does that, and I'm pretty sure removing that from packages is what decreased the bundle sizes |
Summary
The Bazel step building
target_web
now uses the new preset@kbn/babel-preset/web_preset
. The main difference with@kbn/babel-preset/webpack_preset
is that it initially emits browser-agnostic ES modules.Motivation
In Kibana, when building the packages'
target_web
version, the transpiled code is not the final bundle we ship to the browsers. The final bundle is built at a later stage by Webpack in@kbn/optimizer
.For this reason, building a browserlist-compiled version of
target_web
creates a larger package output that will be concatenated to the code before Webpack applies the browserlist version of the final bundle. IMO, we don't need that 2-level browserlist-fy process and we can rely on the final Webpack step to do that.Related to #88678
For maintainers