diff --git a/.vscode/launch.json b/.vscode/launch.json index 1fb22ce..113db74 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,19 +6,25 @@ "configurations": [ { "name": "relayer", - "type": "node", + "type": "pwa-node", "request": "launch", - "runtimeExecutable": "node", + "program": "${workspaceFolder}/src/index.ts", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "npx", "runtimeArgs": [ - "--inspect-brk=8888", - "--nolazy", + "ts-node", + "--inspect-brk=8888" + ], + "args": [ "-r", "ts-node/register/transpile-only", + "src/index.ts" + ], + "skipFiles": [ + "/**", + "**/__awaiter**", ], - "args": ["src/index"], - "cwd": "${workspaceRoot}", - "internalConsoleOptions": "openOnSessionStart", - "skipFiles": ["/**"] + "internalConsoleOptions": "openOnSessionStart" } ] } diff --git a/package.json b/package.json index ef28a09..a46883d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "acala-wormhole-relayer", "version": "1.6.2", + "type": "module", "description": "", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/tsconfig.json b/tsconfig.json index d401182..1a32eb6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "outDir": "dist", - "target": "es2020", - "module": "commonjs", + "target": "ESNext", + "module": "ESNext", "moduleResolution": "node", "strictNullChecks": true, "lib": ["es2019"], @@ -11,5 +11,11 @@ "esModuleInterop": true }, "include": ["src"], - "exclude": ["**/__tests__/*"] + "exclude": ["**/__tests__/*"], + "ts-node": { + "transpileOnly": true, + "files": true, + "esm": true, + "experimentalSpecifierResolution": "node", + } }