timlrx / rehype-prism-plus

rehype plugin to highlight code blocks in HTML with Prism (via refractor) with line highlighting and line numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type error fixes cause errors in next.js

jaywcjlove opened this issue · comments

          @timlrx Type error fixes cause errors in next.js

Originally posted by @jaywcjlove in #64 (comment)

"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/rehype-prism-plus.es.js"
},
"./common": {
"types": "./dist/src/common.d.ts",
"import": "./dist/common.es.js"
},
"./all": {
"types": "./dist/src/all.d.ts",
"import": "./dist/all.es.js"
},
"./generator": {
"types": "./dist/src/generator.d.ts",
"import": "./dist/generator.es.js"
}

The reason for the error is: import+require must be used in combination in the exports field in next.js.

.
├── all.d.ts
├── all.es.js
├── all.es.js.map
├── common.d.ts
├── common.es.js
├── common.es.js.map
├── generator.d.ts
├── generator.es.js
├── generator.es.js.map
├── index.d.ts
├── index.es.js
└── index.es.js.map

Modified the previous output type directory location

Released as v1.6.3. Thanks for the fix!