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