|
2 | 2 | "name": "react-clock",
|
3 | 3 | "version": "4.4.0",
|
4 | 4 | "description": "An analog clock for your React app.",
|
5 |
| - "main": "dist/cjs/index.js", |
6 |
| - "module": "dist/esm/index.js", |
7 |
| - "source": "src/index.ts", |
8 |
| - "types": "dist/cjs/index.d.ts", |
| 5 | + "type": "module", |
9 | 6 | "sideEffects": [
|
10 | 7 | "*.css"
|
11 | 8 | ],
|
| 9 | + "main": "./dist/cjs/index.js", |
| 10 | + "module": "./dist/esm/index.js", |
| 11 | + "source": "./src/index.ts", |
| 12 | + "types": "./dist/cjs/index.d.ts", |
| 13 | + "exports": { |
| 14 | + ".": { |
| 15 | + "import": "./dist/esm/index.js", |
| 16 | + "require": "./dist/cjs/index.js" |
| 17 | + }, |
| 18 | + "./dist/Clock.css": "./dist/Clock.css" |
| 19 | + }, |
12 | 20 | "scripts": {
|
13 | 21 | "build": "yarn build-js && yarn copy-styles",
|
14 |
| - "build-js": "yarn build-js-esm && yarn build-js-cjs", |
| 22 | + "build-js": "yarn build-js-esm && yarn build-js-cjs && yarn build-js-cjs-package", |
15 | 23 | "build-js-esm": "tsc --project tsconfig.build.json --outDir dist/esm --module esnext",
|
16 | 24 | "build-js-cjs": "tsc --project tsconfig.build.json --outDir dist/cjs --module commonjs",
|
| 25 | + "build-js-cjs-package": "echo '{\n \"type\": \"commonjs\"\n}' > dist/cjs/package.json", |
17 | 26 | "clean": "rimraf dist",
|
18 | 27 | "copy-styles": "cpy 'src/**/*.css' dist",
|
19 | 28 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
23 | 32 | "test": "yarn lint && yarn tsc && yarn prettier && yarn unit",
|
24 | 33 | "tsc": "tsc --noEmit",
|
25 | 34 | "unit": "vitest",
|
26 |
| - "watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\"" |
| 35 | + "watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & yarn build-js-cjs-package & nodemon --watch src --ext css --exec \"yarn copy-styles\"" |
27 | 36 | },
|
28 | 37 | "keywords": [
|
29 | 38 | "clock",
|
|
0 commit comments