|
19 | 19 | "test:e2e:nodejs20x": "echo 'Not Implemented'",
|
20 | 20 | "test:e2e": "echo 'Not Implemented'",
|
21 | 21 | "watch": "jest --watch",
|
22 |
| - "build": "tsc --build --force", |
| 22 | + "build:cjs": "tsc --build --force && echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", |
| 23 | + "build:esm": "tsc --project tsconfig.esm.json && echo '{ \"type\": \"module\" }' > lib/esm/package.json", |
| 24 | + "build": "npm run build:esm & npm run build:cjs", |
23 | 25 | "lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
|
24 | 26 | "lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .",
|
25 | 27 | "prebuild": "rimraf ./lib",
|
26 |
| - "prepack": "node ../../.github/scripts/release_patch_package_json.js ." |
| 28 | + "prepack": "rimraf ./lib/*.tsbuildinfo && node ../../.github/scripts/release_patch_package_json.js ." |
27 | 29 | },
|
28 | 30 | "lint-staged": {
|
29 | 31 | "*.{js,ts}": "npm run lint-fix"
|
30 | 32 | },
|
31 | 33 | "homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/batch#readme",
|
32 | 34 | "license": "MIT-0",
|
33 |
| - "main": "./lib/index.js", |
34 |
| - "types": "./lib/index.d.ts", |
| 35 | + "type": "module", |
| 36 | + "exports": { |
| 37 | + ".": { |
| 38 | + "require": { |
| 39 | + "types": "./lib/cjs/index.d.ts", |
| 40 | + "default": "./lib/cjs/index.js" |
| 41 | + }, |
| 42 | + "import": { |
| 43 | + "types": "./lib/esm/index.d.ts", |
| 44 | + "default": "./lib/esm/index.js" |
| 45 | + } |
| 46 | + }, |
| 47 | + "./types": { |
| 48 | + "import": "./lib/esm/types.js", |
| 49 | + "require": "./lib/cjs/types.js" |
| 50 | + } |
| 51 | + }, |
| 52 | + "typesVersions": { |
| 53 | + "*": { |
| 54 | + "types": [ |
| 55 | + "lib/cjs/types.d.ts", |
| 56 | + "lib/esm/types.d.ts" |
| 57 | + ] |
| 58 | + } |
| 59 | + }, |
| 60 | + "types": "./lib/cjs/index.d.ts", |
| 61 | + "main": "./lib/cjs/index.js", |
35 | 62 | "files": [
|
36 | 63 | "lib"
|
37 | 64 | ],
|
|
0 commit comments