|
5 | 5 | "publishConfig": {
|
6 | 6 | "registry": "https://npm.pkg.github.com"
|
7 | 7 | },
|
8 |
| - "main": "cjs/index.js", |
9 |
| - "module": "es/index.js", |
10 |
| - "jsnext:main": "es/index.js", |
| 8 | + "type": "module", |
11 | 9 | "unpkg": "dist/apidom.browser.min.js",
|
12 | 10 | "types": "types/dist.d.ts",
|
| 11 | + "exports": { |
| 12 | + "import": "./es/index.js", |
| 13 | + "require": "./cjs/index.cjs" |
| 14 | + }, |
13 | 15 | "scripts": {
|
14 | 16 | "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
|
15 | 17 | "build:es": "cross-env BABEL_ENV=es babel src --out-dir es --extensions '.ts' --root-mode 'upward'",
|
16 |
| - "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir cjs --extensions '.ts' --root-mode 'upward'", |
| 18 | + "build:cjs": "cross-env BABEL_ENV=cjs-new babel src --out-dir cjs --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'", |
17 | 19 | "build:umd:browser": "cross-env BABEL_ENV=browser BROWSERSLIST_ENV=production webpack --config config/webpack/browser.config.js --progress",
|
18 | 20 | "lint": "eslint ./",
|
19 | 21 | "lint:fix": "eslint ./ --fix",
|
20 | 22 | "clean": "rimraf ./es ./cjs ./dist ./types",
|
21 | 23 | "typescript:check-types": "tsc --noEmit",
|
22 | 24 | "typescript:declaration": "tsc -p declaration.tsconfig.json && copyfiles -u 2 ../@types/*.d.ts ./types && rollup -c config/rollup/types.dist.js",
|
23 |
| - "test": "cross-env BABEL_ENV=cjs mocha", |
| 25 | + "test": "cross-env NODE_ENV=test BABEL_ENV=cjs-new mocha", |
24 | 26 | "test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 BABEL_ENV=cjs mocha",
|
25 | 27 | "prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
|
26 | 28 | "postpack": "rimraf NOTICE LICENSES"
|
|
0 commit comments