|
16 | 16 | "test:e2e:nodejs18x": "echo 'Not Implemented'",
|
17 | 17 | "test:e2e": "echo 'Not Implemented'",
|
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/batch#readme",
|
29 | 31 | "license": "MIT-0",
|
30 |
| - "main": "./lib/index.js", |
31 |
| - "types": "./lib/index.d.ts", |
| 32 | + "type": "module", |
| 33 | + "exports": { |
| 34 | + ".": { |
| 35 | + "require": { |
| 36 | + "types": "./lib/cjs/index.d.ts", |
| 37 | + "default": "./lib/cjs/index.js" |
| 38 | + }, |
| 39 | + "import": { |
| 40 | + "types": "./lib/esm/index.d.ts", |
| 41 | + "default": "./lib/esm/index.js" |
| 42 | + } |
| 43 | + }, |
| 44 | + "./types": { |
| 45 | + "import": "./lib/esm/types.js", |
| 46 | + "require": "./lib/cjs/types.js" |
| 47 | + } |
| 48 | + }, |
| 49 | + "typesVersions": { |
| 50 | + "*": { |
| 51 | + "types": [ |
| 52 | + "lib/cjs/types.d.ts", |
| 53 | + "lib/esm/types.d.ts" |
| 54 | + ] |
| 55 | + } |
| 56 | + }, |
| 57 | + "types": "./lib/cjs/index.d.ts", |
| 58 | + "main": "./lib/cjs/index.js", |
32 | 59 | "files": [
|
33 | 60 | "lib"
|
34 | 61 | ],
|
|
0 commit comments