Skip to content

Use separate Babel configuration for Jest#4594

Merged
gusevda merged 2 commits intoweaveworks:mainfrom
gusevda:separate-babel-config-for-testing
Jan 21, 2025
Merged

Use separate Babel configuration for Jest#4594
gusevda merged 2 commits intoweaveworks:mainfrom
gusevda:separate-babel-config-for-testing

Conversation

@gusevda
Copy link
Copy Markdown
Contributor

@gusevda gusevda commented Jan 21, 2025

What changed?
Separate Babel configuration babel.config.testing.json was added in this PR for being used only for testing by Jest. Tests specific configuration includes @babel/preset-env preset that is not needed for Parcel builds. From the default Babel configuration this preset was removed.

Why was this change made?
This change was made to deal with warnings that Parcel displays during build process:

@parcel/transformer-babel: Parcel includes transpilation by default. 
Babel config babel.config.json includes the following redundant presets: @babel/preset-env. 
Removing these may improve build performance.

  weave-gitops/babel.config.json:4:13
    3 |         [
  > 4 |             "@babel/preset-env",
  >   |             ^^^^^^^^^^^^^^^^^^^
    5 |             {
    6 |                 "targets": {

  💡 Remove the above presets from babel.config.json
  📝 Learn more: https://parceljs.org/languages/javascript/#default-presets

@gusevda gusevda force-pushed the separate-babel-config-for-testing branch from b7213fd to 73c118f Compare January 21, 2025 17:37
@gusevda gusevda requested a review from a team January 21, 2025 17:38
casibbald
casibbald previously approved these changes Jan 21, 2025
@casibbald
Copy link
Copy Markdown
Collaborator

Ace!
I tried to fix this but did not get anywhere with it

@gusevda gusevda force-pushed the separate-babel-config-for-testing branch from 776b20e to 4d99b82 Compare January 21, 2025 19:21
@gusevda gusevda enabled auto-merge (squash) January 21, 2025 19:21
@gusevda gusevda requested a review from casibbald January 21, 2025 19:27
@gusevda gusevda merged commit 24978f6 into weaveworks:main Jan 21, 2025
@gusevda gusevda deleted the separate-babel-config-for-testing branch January 22, 2025 07:40
This was referenced Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants