|
3 | 3 | "description": "Javascript scraper module for Open Graph and Twitter Card info", |
4 | 4 | "version": "2.0.0", |
5 | 5 | "license": "MIT", |
6 | | - "main": "./dist/index.js", |
7 | | - "types": "./dist/index.d.ts", |
| 6 | + "main": "./dist/cjs/index.js", |
| 7 | + "types": "./types/index.d.ts", |
| 8 | + "exports": { |
| 9 | + ".": { |
| 10 | + "types": "./types/index.d.ts", |
| 11 | + "import": "./dist/esm/index.js", |
| 12 | + "require": "./dist/cjs/index.js" |
| 13 | + } |
| 14 | + }, |
8 | 15 | "scripts": { |
9 | | - "build": "rm -rf dist/ && tsc", |
10 | | - "ci": "npm run eslint && npm run build && npm run test", |
| 16 | + "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir dist/cjs/", |
| 17 | + "build:declaration": "tsc --project tsconfig.declaration.json --module node16 --moduleResolution node16", |
| 18 | + "build:esm": "tsc --project tsconfig.build.json --module node16 --moduleResolution node16 --outDir dist/esm/", |
| 19 | + "build": "rm -rf dist/ && npm run build:cjs && npm run build:esm", |
| 20 | + "ci": "npm run eslint && npm run build && npm run build:declaration && npm run test", |
11 | 21 | "eslint:fix": "eslint . --ext .js,.ts --fix", |
12 | 22 | "eslint": "eslint . --ext .js,.ts", |
13 | 23 | "mocha:unit": "nyc --reporter=html --reporter=text --exclude=tests/ ts-mocha --recursive \"./tests/unit/**/*.spec.ts\"", |
|
0 commit comments