|
9 | 9 | "license": "MIT",
|
10 | 10 | "author": "GitHub Inc. (https://github.com)",
|
11 | 11 | "type": "module",
|
| 12 | + "main": "dist/cjs/index.js", |
| 13 | + "module": "dist/esm/index.js", |
12 | 14 | "exports": {
|
13 |
| - ".": "./dist/index.js", |
14 |
| - "./decorator": "./dist/decorator.js" |
| 15 | + ".": { |
| 16 | + "module": "./dist/esm/index.js", |
| 17 | + "import": "./dist/esm/index.js", |
| 18 | + "require": "./dist/cjs/index.js", |
| 19 | + "types": "./dist/esm/index.d.ts" |
| 20 | + }, |
| 21 | + "./decorator": { |
| 22 | + "module": "./dist/esm/decorator.js", |
| 23 | + "import": "./dist/esm/decorator.js", |
| 24 | + "require": "./dist/cjs/decorator.js", |
| 25 | + "types": "./dist/esm/decorator.d.ts" |
| 26 | + } |
15 | 27 | },
|
16 |
| - "main": "dist/index.js", |
17 |
| - "module": "dist/index.js", |
18 |
| - "types": "dist/index.d.ts", |
| 28 | + "types": "./dist/esm/index.d.ts", |
19 | 29 | "files": [
|
20 |
| - "dist" |
| 30 | + "dist", |
| 31 | + "decorator" |
21 | 32 | ],
|
22 | 33 | "scripts": {
|
23 | 34 | "prebuild": "npm run clean && npm run lint && mkdir dist",
|
24 |
| - "build": "tsc", |
| 35 | + "build": "npm run build:esm && npm run build:cjs", |
| 36 | + "build:esm": "tsc", |
| 37 | + "build:cjs": "tsc --module commonjs --outDir dist/cjs", |
25 | 38 | "clean": "rm -rf dist",
|
26 | 39 | "lint": "eslint --report-unused-disable-directives . --color --ext .js,.ts,.tsx && tsc --noEmit",
|
27 | 40 | "prepublishOnly": "npm run build",
|
|
0 commit comments