Skip to content

Commit

Permalink
Merge pull request #229 from jshemas/exports-fix
Browse files Browse the repository at this point in the history
Fixed issue with `package.json` `exports` was not working in `NextJs` projects.
  • Loading branch information
jshemas authored Jun 26, 2024
2 parents 7c61e52 + 5500e98 commit 0de0a7a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 89 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 6.6.1

- Use `node16` for `module`/`moduleResolution` ESM build
- Fixed issue with `package.json` `exports` was not working in `NextJs` projects.

## 6.6.0

- Updating the `tsc` build process to better support both `ESM` and `commonJS`
Expand Down
143 changes: 70 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 10 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
{
"name": "open-graph-scraper",
"description": "Node.js scraper module for Open Graph and Twitter Card info",
"version": "6.6.0",
"version": "6.6.1",
"license": "MIT",
"exports": {
".": {
"import": {
"default": "./dist/esm/index.js",
"types": "./types/index.d.ts"
},
"require": {
"default": "./dist/cjs/index.js",
"types": "./types/index.d.ts"
}
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"types": "./types/index.d.ts"
}
},
"main": "./dist/cjs/index.js",
"scripts": {
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir dist/cjs/",
"build:declaration": "tsc --project tsconfig.declaration.json --module ESNext --moduleResolution bundler",
"build:esm": "tsc --project tsconfig.build.json --module ESNext --moduleResolution bundler --outDir dist/esm/",
"build:declaration": "tsc --project tsconfig.declaration.json --module node16 --moduleResolution node16",
"build:esm": "tsc --project tsconfig.build.json --module node16 --moduleResolution node16 --outDir dist/esm/",
"build": "rm -rf dist/ && npm run build:cjs && npm run build:esm",
"ci": "npm run eslint && npm run build && build:declaration && npm run test",
"eslint:fix": "eslint . --ext .js,.ts --fix",
Expand Down Expand Up @@ -52,20 +46,20 @@
"CHANGELOG.md"
],
"devDependencies": {
"@snyk/protect": "^1.1291.1",
"@snyk/protect": "^1.1292.0",
"@types/mocha": "^10.0.7",
"@types/node": "^18.19.39",
"@types/validator": "^13.12.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"chai": "^4.4.1",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-mocha": "^10.4.3",
"eslint-plugin-promise": "^6.2.0",
"mocha": "^10.4.0",
"mocha": "^10.5.2",
"nyc": "^17.0.0",
"sinon": "^18.0.0",
"ts-mocha": "^10.0.0",
Expand Down

0 comments on commit 0de0a7a

Please sign in to comment.