|
7 | 7 | "exports": { |
8 | 8 | ".": { |
9 | 9 | "import": "./lib/index.js", |
10 | | - "types": "./lib/index.d.ts" |
| 10 | + "types": "./lib/index.d.ts", |
| 11 | + "require": "./cjs/index.js" |
11 | 12 | } |
12 | 13 | }, |
| 14 | + "main": "./cjs/index.js", |
| 15 | + "module": "./lib/index.js", |
13 | 16 | "types": "./lib/index.d.ts", |
14 | 17 | "sideEffects": false, |
15 | 18 | "files": [ |
16 | | - "lib/**/*" |
| 19 | + "lib/**/*", |
| 20 | + "cjs/**/*" |
17 | 21 | ], |
18 | 22 | "engines": { |
19 | 23 | "node": "^12.20.0 || ^14.13.1 || >=16.0.0" |
|
30 | 34 | "prepack": "yarn run build", |
31 | 35 | "prepublish": "yarn run test", |
32 | 36 | "test": "yarn run check && yarn run lint", |
33 | | - "check": "yarn run compile --noEmit", |
| 37 | + "check": "yarn run compile:esm --noEmit", |
34 | 38 | "lint": "xo ./src", |
35 | | - "clean": "rimraf lib", |
36 | | - "compile": "tsc", |
37 | | - "build": "yarn run clean && yarn run compile", |
38 | | - "dev": "yarn run clean && yarn run compile --watch" |
| 39 | + "clean:esm": "rimraf lib", |
| 40 | + "clean:cjs": "rimraf cjs", |
| 41 | + "clean": "yarn run clean:esm && yarn run clean:cjs", |
| 42 | + "compile:esm": "tsc", |
| 43 | + "compile:cjs": "tsc --outDir cjs --module commonjs", |
| 44 | + "build:esm": "yarn run clean:esm && yarn run compile:esm", |
| 45 | + "build:cjs": "yarn run clean:cjs && yarn run compile:cjs", |
| 46 | + "build": "yarn run build:esm && yarn run build:cjs", |
| 47 | + "dev": "yarn run clean:esm && yarn run compile:esm --watch" |
39 | 48 | }, |
40 | 49 | "license": "MIT", |
41 | 50 | "devDependencies": { |
|
0 commit comments