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): .swcrc path should be customizable #10118

Merged
merged 5 commits into from
May 3, 2022
Merged

fix(js): .swcrc path should be customizable #10118

merged 5 commits into from
May 3, 2022

Conversation

djgrant
Copy link
Contributor

@djgrant djgrant commented May 3, 2022

Current Behavior

It is currently not possible to provide a custom path to an swcrc path. Instead, JS projects using SWC must have a .lib.swcrc file in the project root directory.

Expected Behavior

With these changes, the @nrwl/js:swc executor can optionally be be passed an swcrcPath.

In project.json:

{
  "targets": {
    "build": {
      "executor": "@nrwl/js:swc",
      "options": {
        ...
        "swcrcPath": "path/to/swcrc"
      }
    }
  }
}

Related Issue(s)

Fixes #10058

@nx-cloud
Copy link

nx-cloud bot commented May 3, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 37b7e27. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented May 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) May 3, 2022 at 5:08PM (UTC)

Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, one small nit that will likely require updating a few unit tests.

@@ -35,6 +35,7 @@ export interface ExecutorOptions {
main: string;
outputPath: string;
tsConfig: string;
swcrcPath?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop should be required since it has a default value, and the function would not work correctly if its null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! I've pushed the change. Unit tests pass locally without any changes. I didn't mange to get E2E tests running on main and couldn't find any coverage for this codepath so I'll just see if the tests pass on CI.

@AgentEnder AgentEnder changed the title chore(js): add option for swcrc path fix(js): .swcrc path should be customizable May 3, 2022
@AgentEnder AgentEnder merged commit a68120a into nrwl:master May 3, 2022
@djgrant djgrant deleted the chore/js/swc-config-path branch May 3, 2022 18:30
@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.

Custom swcrc path
2 participants