diff --git a/.eslintrc.json b/.eslintrc.json index 5a222b9e..b2dd0454 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -37,6 +37,7 @@ }, "ignorePatterns": [ "scripts/**", + "register.js", "!.projenrc.ts", "!projenrc/**/*.ts" ], diff --git a/.projenrc.ts b/.projenrc.ts index bf4fcb3e..ca410373 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -145,7 +145,7 @@ const project = new CustomTypescriptProject({ ], eslintOptions: { dirs: ["src", "test"], - ignorePatterns: ["scripts/**"], + ignorePatterns: ["scripts/**", "register.js"], lintProjenRc: false, }, tsconfig: { diff --git a/register.js b/register.js new file mode 100644 index 00000000..e7f220ac --- /dev/null +++ b/register.js @@ -0,0 +1,26 @@ +const register = require("@swc/register/lib/node").default; + +register({ + jsc: { + parser: { + syntax: "typescript", + dynamicImport: false, + decorators: false, + hidden: { + jest: true, + }, + }, + transform: null, + target: "es2022", + loose: false, + externalHelpers: false, + experimental: { + plugins: [["@functionless/ast-reflection", {}]], + }, + }, + minify: true, + sourceMaps: "inline", + module: { + type: "commonjs", + }, +}); diff --git a/test-app/.swcrc b/test-app/.swcrc deleted file mode 100644 index 7a21792b..00000000 --- a/test-app/.swcrc +++ /dev/null @@ -1,29 +0,0 @@ -{ - "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" - } -} diff --git a/test-app/cdk.json b/test-app/cdk.json index da048aa5..d7a8d03a 100644 --- a/test-app/cdk.json +++ b/test-app/cdk.json @@ -1,3 +1,3 @@ { - "app": "node -r '@swc/register' ./src/message-board.ts" + "app": "node -r 'functionless/register' ./src/message-board.ts" }