From 8e0346a671f15b8272abc025ea7bdb42081b3b2e Mon Sep 17 00:00:00 2001 From: Lassi Koivisto Date: Sun, 8 Sep 2024 14:03:42 +0300 Subject: [PATCH] build: initial working build setup Changed from ts-node to node with ts-node/esm as the loader. There is a bug with ts-node that breaks things when using ESM style modules only. see: https://github.com/TypeStrong/ts-node/issues/2100 --- cdk.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cdk.json b/cdk.json index 092dc32..d824adf 100644 --- a/cdk.json +++ b/cdk.json @@ -1,9 +1,7 @@ { - "app": "npx ts-node --prefer-ts-exts bin/helloer.ts", + "app": "node --loader ts-node/esm --experimental-specifier-resolution=node src/bin/helloer.ts", "watch": { - "include": [ - "**" - ], + "include": ["**"], "exclude": [ "README.md", "cdk*.json", @@ -19,10 +17,7 @@ "context": { "@aws-cdk/aws-lambda:recognizeLayerVersion": true, "@aws-cdk/core:checkSecretUsage": true, - "@aws-cdk/core:target-partitions": [ - "aws", - "aws-cn" - ], + "@aws-cdk/core:target-partitions": ["aws", "aws-cn"], "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,