Skip to content
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

fix(js): adjust .swcrc so that it works with swc/jest and no temp .swcrc needed (with migrations) #9198

Merged
merged 4 commits into from Mar 7, 2022

Conversation

nartc
Copy link
Contributor

@nartc nartc commented Mar 4, 2022

Current Behavior

  • .swcrc does not include exclude field (to exclude test files) because swc/jest reads the configuration from .swcrc and will not compile the test files.
  • exclude configuration is offload to the executor's option under swcExclude and a temp .swcrc is generated on build
  • --source-maps is hardcoded

Expected Behavior

  • .lib.swcrc is generated instead of .swcrc and has exclude field populated properly. This makes swcExclude executor option deprecated.
  • swc cli reads the configuration from .lib.swcrc
  • swc/jest receives the configuration from reading .lib.swcrc in jest.config.js, without the exclude field. This allows consumers to adjust the SWC configuration as they see fit for both build and test.
  • --source-maps has been removed from swc cli command. It is added to .lib.swcrc by default. The consumers can change the value of sourceMaps as they see fit.

Related Issue(s)

Fixes #9187

@nx-cloud
Copy link

nx-cloud bot commented Mar 4, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit d88b534. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 7 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Mar 4, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/4kk6yJgzpR8HGsLaQRzyMxpMMWwJ
✅ Preview: Canceled

[Deployment for d88b534 canceled]

@nartc nartc merged commit 7d5988b into master Mar 7, 2022
@FrozenPandaz FrozenPandaz deleted the adjust-swcrc branch June 7, 2022 23:31
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

swc compile command has hardcoded sourcemaps
2 participants