Skip to content

feat: migrate to SWC - #14

Merged
sam-goodwin merged 6 commits into
mainfrom
samg-swc
Aug 9, 2022
Merged

feat: migrate to SWC#14
sam-goodwin merged 6 commits into
mainfrom
samg-swc

Conversation

@sam-goodwin

@sam-goodwin sam-goodwin commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

Fixes #13

This change migrates Functionless projects to SWC instead of ts-patch with ts-transformers.

  • configure -r "@swc/register" to cdk synth command
  • .swcrc
    A new file, .swcrc, is emitted to the project root that configures how SWC transforms TS -> JS. Most importantly, it runs @functionless/ast-reflection .
{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "dynamicImport": false,
      "decorators": false,
      "hidden": {
        "jest": true
      }
    },
    "transform": null,
    "target": "es2021",
    "loose": false,
    "externalHelpers": false,
    "experimental": {
      "plugins": [["@functionless/ast-reflection", {}]]
    }
  },
  "minify": false,
  "sourceMaps": "inline",
  "module": {
    "type": "commonjs"
  }
}
  • jest.config
{
  "transform": {
    "^.+\\.(t|j)sx?$": ["@swc/jest", {}],
  }
}

@sam-goodwin
sam-goodwin merged commit 7ea2635 into main Aug 9, 2022
@sam-goodwin
sam-goodwin deleted the samg-swc branch August 9, 2022 04:46
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.

Update template to use SWC instead of ts-patch

2 participants