Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support nextjs 13 (fix #65) #66

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions index.js

This file was deleted.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
"files": [
"dist"
],
"main": "./dist/rehype-prism-plus.es.js",
"module": "./dist/rehype-prism-plus.es.js",
"main": "./dist/index.es.js",
"module": "./dist/index.es.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/rehype-prism-plus.es.js"
"default": "./dist/index.es.js"
},
"./common": {
"types": "./dist/src/common.d.ts",
"import": "./dist/common.es.js"
"types": "./dist/common.d.ts",
"default": "./dist/common.es.js"
},
"./all": {
"types": "./dist/src/all.d.ts",
"import": "./dist/all.es.js"
"types": "./dist/all.d.ts",
"default": "./dist/all.es.js"
},
"./generator": {
"types": "./dist/src/generator.d.ts",
"import": "./dist/generator.es.js"
"types": "./dist/generator.d.ts",
"default": "./dist/generator.es.js"
}
},
"typesVersions": {
Expand All @@ -34,18 +34,18 @@
"./dist/index"
],
"common": [
"./dist/src/common"
"./dist/common"
],
"all": [
"./dist/src/all"
"./dist/all"
],
"generator": [
"./dist/src/generator"
"./dist/generator"
]
}
},
"scripts": {
"build": "tsc -b && microbundle index.js src/common.js src/all.js src/generator.js --format esm",
"build": "tsc -b && microbundle src/index.js src/common.js src/all.js src/generator.js --format esm",
"tsc": "tsc --watch",
"lint": "eslint .",
"prettier": "prettier --write '*.js'",
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import rehypePrismGenerator from './generator.js'
import rehypePrismCommon from './common.js'
import rehypePrism from './all.js'

export { rehypePrismGenerator, rehypePrismCommon }
export default rehypePrism
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import rehypeStringify from 'rehype-stringify'
import dedent from 'dedent'
import rehypePrism from './index.js'
import rehypePrism from './src/index.js'

/**
* Mock meta in code block
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["index.js", "src/*"],
"include": ["src/*"],
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020"],
Expand Down