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

Added SWCRC env variable #678

Merged
merged 1 commit into from Dec 9, 2022

Conversation

candunaj
Copy link
Contributor

@candunaj candunaj commented Nov 24, 2022

This PR adds the ability to load the .swcrc file when running the following command:

SWCRC=true node -r @swc-node/register index.ts

.swcrc file is needed in some scenarios, and there was no option to load it. For example, when you need to use a plugin, you need to use the following .swcrc file:

{
  "jsc": {
    "experimental": {
      "plugins": [
        [
          "SWC-plugin-formatjs",
          {
            "overrideIdFn": "[sha512:contenthash:base64:6]"
          }
        ]
      ]
    }
  }
}

I have chosen an environment variable because it was the simplest solution with minimal impact. I did not want to cause breaking change, so it is opt-in rather than opt-out. This way, it can be a minor version bump.

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2022

CLA assistant check
All committers have signed the CLA.

@candunaj candunaj marked this pull request as ready for review November 24, 2022 08:50
@Brooooooklyn Brooooooklyn merged commit e7bfe70 into swc-project:master Dec 9, 2022
@mansona
Copy link

mansona commented Dec 21, 2022

Hey thanks for merging this @Brooooooklyn 🎉

Is there any chance we can get a release cut for it?

@ibash
Copy link

ibash commented Jan 4, 2023

@mansona just published this at @ibash/swc-node-register if you still need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants