|
17 | 17 | "test:e2e:nodejs20x": "RUNTIME=nodejs20x jest --group=e2e", |
18 | 18 | "test:e2e": "jest --group=e2e", |
19 | 19 | "watch": "jest --watch", |
20 | | - "build": "tsc --build --force", |
| 20 | + "build:cjs": "tsc --build --force && echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", |
| 21 | + "build:esm": "tsc --project tsconfig.esm.json && echo '{ \"type\": \"module\" }' > lib/esm/package.json", |
| 22 | + "build": "npm run build:esm & npm run build:cjs", |
21 | 23 | "lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .", |
22 | 24 | "lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .", |
23 | 25 | "prebuild": "rimraf ./lib", |
24 | | - "prepack": "node ../../.github/scripts/release_patch_package_json.js ." |
| 26 | + "prepack": "rimraf ./lib/*.tsbuildinfo && node ../../.github/scripts/release_patch_package_json.js ." |
25 | 27 | }, |
26 | 28 | "lint-staged": { |
27 | 29 | "*.{js,ts}": "npm run lint-fix" |
28 | 30 | }, |
29 | 31 | "homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/tracer#readme", |
30 | 32 | "license": "MIT-0", |
31 | | - "main": "./lib/index.js", |
32 | | - "types": "./lib/index.d.ts", |
33 | 33 | "devDependencies": { |
34 | 34 | "@aws-lambda-powertools/testing-utils": "file:../testing", |
35 | 35 | "@aws-sdk/client-dynamodb": "^3.506.0", |
|
47 | 47 | "optional": true |
48 | 48 | } |
49 | 49 | }, |
| 50 | + "type": "module", |
| 51 | + "exports": { |
| 52 | + ".": { |
| 53 | + "require": { |
| 54 | + "types": "./lib/cjs/index.d.ts", |
| 55 | + "default": "./lib/cjs/index.js" |
| 56 | + }, |
| 57 | + "import": { |
| 58 | + "types": "./lib/esm/index.d.ts", |
| 59 | + "default": "./lib/esm/index.js" |
| 60 | + } |
| 61 | + }, |
| 62 | + "./middleware": { |
| 63 | + "import": "./lib/esm/middleware/middy.js", |
| 64 | + "require": "./lib/cjs/middleware/middy.js" |
| 65 | + }, |
| 66 | + "./types": { |
| 67 | + "import": "./lib/esm/types/index.js", |
| 68 | + "require": "./lib/cjs/types/index.js" |
| 69 | + } |
| 70 | + }, |
| 71 | + "typesVersions": { |
| 72 | + "*": { |
| 73 | + "middleware": [ |
| 74 | + "lib/cjs/middleware/middy.d.ts", |
| 75 | + "lib/esm/middleware/middy.d.ts" |
| 76 | + ], |
| 77 | + "types": [ |
| 78 | + "lib/cjs/types/index.d.ts", |
| 79 | + "lib/esm/types/index.d.ts" |
| 80 | + ] |
| 81 | + } |
| 82 | + }, |
| 83 | + "types": "./lib/cjs/index.d.ts", |
| 84 | + "main": "./lib/cjs/index.js", |
50 | 85 | "files": [ |
51 | 86 | "lib" |
52 | 87 | ], |
|
0 commit comments