Skip to content

Commit

Permalink
Change to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 1, 2023
1 parent a9f253b commit fb00d7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import React from 'react'
import * as dev from 'react/jsx-dev-runtime'
import * as prod from 'react/jsx-runtime'
import server from 'react-dom/server'
import rehypeReact from 'rehype-react'
import {unified} from 'unified'
import rehypeReact from './index.js'

/** @type {{Fragment: Fragment, jsx: Jsx, jsxs: Jsx}} */
// @ts-expect-error: the react types are missing.
Expand All @@ -24,7 +24,7 @@ const development = {Fragment: dev.Fragment, jsxDEV: dev.jsxDEV}

test('React ' + React.version, async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
assert.deepEqual(Object.keys(await import('rehype-react')).sort(), [
'default'
])
})
Expand Down

0 comments on commit fb00d7b

Please sign in to comment.